├── .circleci └── config.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── build.sh ├── common ├── CMakeLists.txt ├── base_screen.cpp ├── base_struct.cpp ├── base_units.cpp ├── basicframe.cpp ├── bezier_curves.cpp ├── bin_mod.cpp ├── bitmap.cpp ├── block_commande.cpp ├── build_version.cpp ├── class_bitmap_base.cpp ├── class_colors_design_settings.cpp ├── class_layer_box_selector.cpp ├── class_marker_base.cpp ├── class_page_info.cpp ├── class_plotter.cpp ├── class_undoredo_container.cpp ├── colors.cpp ├── common.cpp ├── common_plotDXF_functions.cpp ├── common_plotGERBER_functions.cpp ├── common_plotHPGL_functions.cpp ├── common_plotPDF_functions.cpp ├── common_plotPS_functions.cpp ├── common_plotSVG_functions.cpp ├── common_plot_functions.cpp ├── config_params.cpp ├── confirm.cpp ├── convert_basic_shapes_to_polygon.cpp ├── copy_to_clipboard.cpp ├── dialog_about │ ├── AboutDialog_main.cpp │ ├── aboutinfo.h │ ├── dialog_about.cpp │ ├── dialog_about.h │ ├── dialog_about_base.cpp │ ├── dialog_about_base.fbp │ └── dialog_about_base.h ├── dialog_shim.cpp ├── dialogs │ ├── dialog_display_info_HTML_base.cpp │ ├── dialog_display_info_HTML_base.fbp │ ├── dialog_display_info_HTML_base.h │ ├── dialog_env_var_config.cpp │ ├── dialog_env_var_config_base.cpp │ ├── dialog_env_var_config_base.fbp │ ├── dialog_env_var_config_base.h │ ├── dialog_exit_base.cpp │ ├── dialog_exit_base.fbp │ ├── dialog_exit_base.h │ ├── dialog_get_component.cpp │ ├── dialog_get_component_base.cpp │ ├── dialog_get_component_base.fbp │ ├── dialog_get_component_base.h │ ├── dialog_hotkeys_editor.cpp │ ├── dialog_hotkeys_editor_base.cpp │ ├── dialog_hotkeys_editor_base.fbp │ ├── dialog_hotkeys_editor_base.h │ ├── dialog_image_editor.cpp │ ├── dialog_image_editor.fbp │ ├── dialog_image_editor.h │ ├── dialog_image_editor_base.cpp │ ├── dialog_image_editor_base.h │ ├── dialog_list_selector_base.cpp │ ├── dialog_list_selector_base.fbp │ ├── dialog_list_selector_base.h │ ├── dialog_page_settings.cpp │ ├── dialog_page_settings.h │ ├── dialog_page_settings_base.cpp │ ├── dialog_page_settings_base.fbp │ ├── dialog_page_settings_base.h │ ├── wx_html_report_panel.cpp │ ├── wx_html_report_panel.h │ ├── wx_html_report_panel_base.cpp │ ├── wx_html_report_panel_base.fbp │ └── wx_html_report_panel_base.h ├── displlst.cpp ├── dlist.cpp ├── draw_frame.cpp ├── draw_panel.cpp ├── draw_panel_gal.cpp ├── drawtxt.cpp ├── dsnlexer.cpp ├── eda_dde.cpp ├── eda_doc.cpp ├── eda_text.cpp ├── filter_reader.cpp ├── findkicadhelppath.cpp.notused ├── footprint_info.cpp ├── fp_lib_table.cpp ├── fp_lib_table.keywords ├── fpid.cpp ├── gal │ ├── cairo │ │ ├── cairo_compositor.cpp │ │ └── cairo_gal.cpp │ ├── color4d.cpp │ ├── graphics_abstraction_layer.cpp │ ├── opengl │ │ ├── cached_container.cpp │ │ ├── gpu_manager.cpp │ │ ├── noncached_container.cpp │ │ ├── opengl_compositor.cpp │ │ ├── opengl_gal.cpp │ │ ├── shader.cpp │ │ ├── shader.frag │ │ ├── shader.vert │ │ ├── vertex_container.cpp │ │ ├── vertex_item.cpp │ │ └── vertex_manager.cpp │ └── stroke_font.cpp ├── geometry │ ├── hetriang.cpp │ ├── seg.cpp │ ├── shape.cpp │ ├── shape_collisions.cpp │ ├── shape_file_io.cpp │ ├── shape_line_chain.cpp │ └── shape_poly_set.cpp ├── gestfich.cpp ├── getrunningmicrosecs.cpp ├── gr_basic.cpp ├── grid_tricks.cpp ├── hotkeys_basic.cpp ├── html_messagebox.cpp ├── kicad_curl │ ├── kicad_curl.cpp │ └── kicad_curl_easy.cpp ├── kiface_i.cpp ├── kiway.cpp ├── kiway_express.cpp ├── kiway_holder.cpp ├── kiway_player.cpp ├── lockfile.cpp ├── lset.cpp ├── math │ └── math_util.cpp ├── msgpanel.cpp ├── netlist.keywords ├── newstroke_font.cpp ├── origin_viewitem.cpp ├── page_layout │ ├── class_worksheet_dataitem.cpp │ ├── class_worksheet_layout.cpp │ ├── page_layout_default_description.cpp │ ├── page_layout_graphic_items.cpp │ ├── page_layout_reader.cpp │ ├── page_layout_reader.keywords │ └── title_block_shapes.cpp ├── painter.cpp ├── pcb.keywords ├── pcb_plot_params.keywords ├── pcbcommon.cpp ├── pgm_base.cpp ├── prependpath.cpp ├── project.cpp ├── ptree.cpp ├── reporter.cpp ├── richio.cpp ├── search_stack.cpp ├── searchhelpfilefullpath.cpp ├── selcolor.cpp ├── single_top.cpp ├── string.cpp ├── strtok_r.c ├── systemdirsappend.cpp ├── tool │ ├── action_manager.cpp │ ├── context_menu.cpp │ ├── tool_action.cpp │ ├── tool_base.cpp │ ├── tool_dispatcher.cpp │ ├── tool_event.cpp │ ├── tool_interactive.cpp │ └── tool_manager.cpp ├── trigo.cpp ├── utf8.cpp ├── validators.cpp ├── view │ ├── view.cpp │ ├── view_controls.cpp │ ├── view_group.cpp │ ├── view_item.cpp │ └── wx_view_controls.cpp ├── wildcards_and_files_ext.cpp ├── worksheet.cpp ├── worksheet_viewitem.cpp ├── wx_status_popup.cpp ├── wx_unit_binder.cpp ├── wxunittext.cpp ├── wxwineda.cpp ├── xnode.cpp └── zoom.cpp ├── doc └── resources │ ├── showcase.jpeg │ ├── windows_step_0.png │ ├── windows_step_1.png │ ├── windows_step_2.png │ └── windows_step_3.png ├── examples ├── myFirstPCB.svg ├── myFirstPCB_comboScreen.png └── viruspcb.svg ├── include ├── HersheyCyrillic.h.unused ├── base_struct.h ├── base_units.h ├── bezier_curves.h ├── bin_mod.h ├── bitmaps.h ├── block_commande.h ├── build_version.h ├── class_base_screen.h ├── class_bitmap_base.h ├── class_board_design_settings.h ├── class_board_item.h ├── class_collector.h ├── class_colors_design_settings.h ├── class_draw_panel_gal.h ├── class_drawpanel.h ├── class_drc_item.h ├── class_eda_rect.h ├── class_layer_box_selector.h ├── class_macros_record.h ├── class_marker_base.h ├── class_page_info.h ├── class_pcb_screen.h ├── class_title_block.h ├── class_undoredo_container.h ├── class_worksheet_dataitem.h ├── colors.h ├── colors_selection.h ├── common.h ├── config.h ├── config_params.h ├── confirm.h ├── convert_basic_shapes_to_polygon.h ├── convert_from_iu.h ├── convert_to_biu.h ├── core │ └── typeinfo.h ├── dialog_env_var_config.h ├── dialog_get_component.h ├── dialog_helpers.h ├── dialog_hotkeys_editor.h ├── dialog_shim.h ├── dlist.h ├── draw_frame.h ├── drawtxt.h ├── dsnlexer.h ├── eda_dde.h ├── eda_doc.h ├── eda_text.h ├── fctsys.h ├── filter_reader.h ├── footprint_info.h ├── fp_lib_table.h ├── fpid.h ├── frame_type.h ├── gal │ ├── cairo │ │ ├── cairo_compositor.h │ │ └── cairo_gal.h │ ├── color4d.h │ ├── compositor.h │ ├── definitions.h │ ├── graphics_abstraction_layer.h │ ├── opengl │ │ ├── cached_container.h │ │ ├── glm │ │ │ ├── core │ │ │ │ ├── _detail.hpp │ │ │ │ ├── _fixes.hpp │ │ │ │ ├── _swizzle.hpp │ │ │ │ ├── _swizzle_func.hpp │ │ │ │ ├── _vectorize.hpp │ │ │ │ ├── dummy.cpp │ │ │ │ ├── func_common.hpp │ │ │ │ ├── func_common.inl │ │ │ │ ├── func_exponential.hpp │ │ │ │ ├── func_exponential.inl │ │ │ │ ├── func_geometric.hpp │ │ │ │ ├── func_geometric.inl │ │ │ │ ├── func_integer.hpp │ │ │ │ ├── func_integer.inl │ │ │ │ ├── func_matrix.hpp │ │ │ │ ├── func_matrix.inl │ │ │ │ ├── func_noise.hpp │ │ │ │ ├── func_noise.inl │ │ │ │ ├── func_packing.hpp │ │ │ │ ├── func_packing.inl │ │ │ │ ├── func_trigonometric.hpp │ │ │ │ ├── func_trigonometric.inl │ │ │ │ ├── func_vector_relational.hpp │ │ │ │ ├── func_vector_relational.inl │ │ │ │ ├── hint.hpp │ │ │ │ ├── intrinsic_common.hpp │ │ │ │ ├── intrinsic_common.inl │ │ │ │ ├── intrinsic_exponential.hpp │ │ │ │ ├── intrinsic_exponential.inl │ │ │ │ ├── intrinsic_geometric.hpp │ │ │ │ ├── intrinsic_geometric.inl │ │ │ │ ├── intrinsic_matrix.hpp │ │ │ │ ├── intrinsic_matrix.inl │ │ │ │ ├── intrinsic_trigonometric.hpp │ │ │ │ ├── intrinsic_trigonometric.inl │ │ │ │ ├── intrinsic_vector_relational.hpp │ │ │ │ ├── intrinsic_vector_relational.inl │ │ │ │ ├── setup.hpp │ │ │ │ ├── type.hpp │ │ │ │ ├── type_float.hpp │ │ │ │ ├── type_gentype.hpp │ │ │ │ ├── type_gentype.inl │ │ │ │ ├── type_half.hpp │ │ │ │ ├── type_half.inl │ │ │ │ ├── type_int.hpp │ │ │ │ ├── type_mat.hpp │ │ │ │ ├── type_mat.inl │ │ │ │ ├── type_mat2x2.hpp │ │ │ │ ├── type_mat2x2.inl │ │ │ │ ├── type_mat2x3.hpp │ │ │ │ ├── type_mat2x3.inl │ │ │ │ ├── type_mat2x4.hpp │ │ │ │ ├── type_mat2x4.inl │ │ │ │ ├── type_mat3x2.hpp │ │ │ │ ├── type_mat3x2.inl │ │ │ │ ├── type_mat3x3.hpp │ │ │ │ ├── type_mat3x3.inl │ │ │ │ ├── type_mat3x4.hpp │ │ │ │ ├── type_mat3x4.inl │ │ │ │ ├── type_mat4x2.hpp │ │ │ │ ├── type_mat4x2.inl │ │ │ │ ├── type_mat4x3.hpp │ │ │ │ ├── type_mat4x3.inl │ │ │ │ ├── type_mat4x4.hpp │ │ │ │ ├── type_mat4x4.inl │ │ │ │ ├── type_size.hpp │ │ │ │ ├── type_vec.hpp │ │ │ │ ├── type_vec.inl │ │ │ │ ├── type_vec1.hpp │ │ │ │ ├── type_vec1.inl │ │ │ │ ├── type_vec2.hpp │ │ │ │ ├── type_vec2.inl │ │ │ │ ├── type_vec3.hpp │ │ │ │ ├── type_vec3.inl │ │ │ │ ├── type_vec4.hpp │ │ │ │ └── type_vec4.inl │ │ │ ├── ext.hpp │ │ │ ├── glm.hpp │ │ │ ├── gtc │ │ │ │ ├── constants.hpp │ │ │ │ ├── constants.inl │ │ │ │ ├── epsilon.hpp │ │ │ │ ├── epsilon.inl │ │ │ │ ├── half_float.hpp │ │ │ │ ├── half_float.inl │ │ │ │ ├── matrix_access.hpp │ │ │ │ ├── matrix_access.inl │ │ │ │ ├── matrix_integer.hpp │ │ │ │ ├── matrix_inverse.hpp │ │ │ │ ├── matrix_inverse.inl │ │ │ │ ├── matrix_transform.hpp │ │ │ │ ├── matrix_transform.inl │ │ │ │ ├── noise.hpp │ │ │ │ ├── noise.inl │ │ │ │ ├── quaternion.hpp │ │ │ │ ├── quaternion.inl │ │ │ │ ├── random.hpp │ │ │ │ ├── random.inl │ │ │ │ ├── reciprocal.hpp │ │ │ │ ├── reciprocal.inl │ │ │ │ ├── swizzle.hpp │ │ │ │ ├── swizzle.inl │ │ │ │ ├── type_precision.hpp │ │ │ │ ├── type_precision.inl │ │ │ │ ├── type_ptr.hpp │ │ │ │ ├── type_ptr.inl │ │ │ │ ├── ulp.hpp │ │ │ │ └── ulp.inl │ │ │ ├── gtx │ │ │ │ ├── associated_min_max.hpp │ │ │ │ ├── associated_min_max.inl │ │ │ │ ├── bit.hpp │ │ │ │ ├── bit.inl │ │ │ │ ├── closest_point.hpp │ │ │ │ ├── closest_point.inl │ │ │ │ ├── color_cast.hpp │ │ │ │ ├── color_cast.inl │ │ │ │ ├── color_space.hpp │ │ │ │ ├── color_space.inl │ │ │ │ ├── color_space_YCoCg.hpp │ │ │ │ ├── color_space_YCoCg.inl │ │ │ │ ├── compatibility.hpp │ │ │ │ ├── compatibility.inl │ │ │ │ ├── component_wise.hpp │ │ │ │ ├── component_wise.inl │ │ │ │ ├── constants.hpp │ │ │ │ ├── epsilon.hpp │ │ │ │ ├── euler_angles.hpp │ │ │ │ ├── euler_angles.inl │ │ │ │ ├── extend.hpp │ │ │ │ ├── extend.inl │ │ │ │ ├── extented_min_max.hpp │ │ │ │ ├── extented_min_max.inl │ │ │ │ ├── fast_exponential.hpp │ │ │ │ ├── fast_exponential.inl │ │ │ │ ├── fast_square_root.hpp │ │ │ │ ├── fast_square_root.inl │ │ │ │ ├── fast_trigonometry.hpp │ │ │ │ ├── fast_trigonometry.inl │ │ │ │ ├── gradient_paint.hpp │ │ │ │ ├── gradient_paint.inl │ │ │ │ ├── handed_coordinate_space.hpp │ │ │ │ ├── handed_coordinate_space.inl │ │ │ │ ├── inertia.hpp │ │ │ │ ├── inertia.inl │ │ │ │ ├── int_10_10_10_2.hpp │ │ │ │ ├── int_10_10_10_2.inl │ │ │ │ ├── integer.hpp │ │ │ │ ├── integer.inl │ │ │ │ ├── intersect.hpp │ │ │ │ ├── intersect.inl │ │ │ │ ├── log_base.hpp │ │ │ │ ├── log_base.inl │ │ │ │ ├── matrix_cross_product.hpp │ │ │ │ ├── matrix_cross_product.inl │ │ │ │ ├── matrix_interpolation.hpp │ │ │ │ ├── matrix_interpolation.inl │ │ │ │ ├── matrix_major_storage.hpp │ │ │ │ ├── matrix_major_storage.inl │ │ │ │ ├── matrix_operation.hpp │ │ │ │ ├── matrix_operation.inl │ │ │ │ ├── matrix_query.hpp │ │ │ │ ├── matrix_query.inl │ │ │ │ ├── mixed_product.hpp │ │ │ │ ├── mixed_product.inl │ │ │ │ ├── multiple.hpp │ │ │ │ ├── multiple.inl │ │ │ │ ├── noise.hpp │ │ │ │ ├── norm.hpp │ │ │ │ ├── norm.inl │ │ │ │ ├── normal.hpp │ │ │ │ ├── normal.inl │ │ │ │ ├── normalize_dot.hpp │ │ │ │ ├── normalize_dot.inl │ │ │ │ ├── number_precision.hpp │ │ │ │ ├── number_precision.inl │ │ │ │ ├── ocl_type.hpp │ │ │ │ ├── ocl_type.inl │ │ │ │ ├── optimum_pow.hpp │ │ │ │ ├── optimum_pow.inl │ │ │ │ ├── orthonormalize.hpp │ │ │ │ ├── orthonormalize.inl │ │ │ │ ├── perpendicular.hpp │ │ │ │ ├── perpendicular.inl │ │ │ │ ├── polar_coordinates.hpp │ │ │ │ ├── polar_coordinates.inl │ │ │ │ ├── projection.hpp │ │ │ │ ├── projection.inl │ │ │ │ ├── quaternion.hpp │ │ │ │ ├── quaternion.inl │ │ │ │ ├── random.hpp │ │ │ │ ├── raw_data.hpp │ │ │ │ ├── raw_data.inl │ │ │ │ ├── reciprocal.hpp │ │ │ │ ├── rotate_vector.hpp │ │ │ │ ├── rotate_vector.inl │ │ │ │ ├── simd_mat4.hpp │ │ │ │ ├── simd_mat4.inl │ │ │ │ ├── simd_vec4.hpp │ │ │ │ ├── simd_vec4.inl │ │ │ │ ├── spline.hpp │ │ │ │ ├── spline.inl │ │ │ │ ├── std_based_type.hpp │ │ │ │ ├── std_based_type.inl │ │ │ │ ├── string_cast.hpp │ │ │ │ ├── string_cast.inl │ │ │ │ ├── transform.hpp │ │ │ │ ├── transform.inl │ │ │ │ ├── transform2.hpp │ │ │ │ ├── transform2.inl │ │ │ │ ├── ulp.hpp │ │ │ │ ├── unsigned_int.hpp │ │ │ │ ├── unsigned_int.inl │ │ │ │ ├── vec1.hpp │ │ │ │ ├── vec1.inl │ │ │ │ ├── vector_access.hpp │ │ │ │ ├── vector_access.inl │ │ │ │ ├── vector_angle.hpp │ │ │ │ ├── vector_angle.inl │ │ │ │ ├── vector_query.hpp │ │ │ │ ├── vector_query.inl │ │ │ │ ├── verbose_operator.hpp │ │ │ │ ├── verbose_operator.inl │ │ │ │ ├── wrap.hpp │ │ │ │ └── wrap.inl │ │ │ └── virtrev │ │ │ │ └── xstream.hpp │ │ ├── gpu_manager.h │ │ ├── noncached_container.h │ │ ├── opengl_compositor.h │ │ ├── opengl_gal.h │ │ ├── shader.h │ │ ├── vertex_common.h │ │ ├── vertex_container.h │ │ ├── vertex_item.h │ │ └── vertex_manager.h │ └── stroke_font.h ├── geometry │ ├── rtree.h │ ├── seg.h │ ├── shape.h │ ├── shape_circle.h │ ├── shape_convex.h │ ├── shape_file_io.h │ ├── shape_index.h │ ├── shape_index_list.h │ ├── shape_line_chain.h │ ├── shape_poly_set.h │ ├── shape_rect.h │ └── shape_segment.h ├── gestfich.h ├── gr_basic.h ├── grid_tricks.h ├── hashtables.h ├── hotkeys_basic.h ├── html_messagebox.h ├── i18n_utility.h ├── id.h ├── import_export.h ├── ki_mutex.h ├── kicad_curl │ ├── kicad_curl.h │ └── kicad_curl_easy.h ├── kicad_device_context.h ├── kicad_string.h ├── kiface_i.h ├── kiway.h ├── kiway_express.h ├── kiway_mgr.h ├── kiway_player.h ├── layers_id_colors_and_visibility.h ├── length.h.usuned ├── macros.h ├── mail_type.h ├── math │ ├── box2.h │ ├── math_util.h │ ├── matrix3x3.h │ └── vector2d.h ├── menus_helpers.h ├── msgpanel.h ├── newstroke_font.h ├── online_help.h ├── origin_viewitem.h ├── pad_shapes.h ├── painter.h ├── pcbcommon.h ├── pcbstruct.h ├── pgm_base.h ├── plot_common.h ├── profile.h ├── project.h ├── ptree.h ├── reporter.h ├── richio.h ├── search_stack.h ├── tool │ ├── action_manager.h │ ├── context_menu.h │ ├── coroutine.h │ ├── delegate.h │ ├── examples │ │ ├── Makefile │ │ ├── coroutine_example.cpp │ │ └── delegate_example.cpp │ ├── tool_action.h │ ├── tool_base.h │ ├── tool_dispatcher.h │ ├── tool_event.h │ ├── tool_interactive.h │ ├── tool_manager.h │ └── tool_settings.h ├── trigo.h ├── ttl │ ├── halfedge │ │ ├── hedart.h │ │ ├── hetraits.h │ │ └── hetriang.h │ ├── ttl.h │ └── ttl_util.h ├── utf8.h ├── validators.h ├── view │ ├── view.h │ ├── view_controls.h │ ├── view_group.h │ ├── view_item.h │ ├── view_rtree.h │ └── wx_view_controls.h ├── wildcards_and_files_ext.h ├── worksheet.h ├── worksheet_shape_builder.h ├── worksheet_viewitem.h ├── wxBasePcbFrame.h ├── wxPcbStruct.h ├── wx_status_popup.h ├── wx_unit_binder.h ├── wxstruct.h ├── wxunittext.h └── xnode.h ├── inkscape ├── svg2shenzhen │ ├── export.py │ └── prepare.py ├── svg2shenzhen_about.inx ├── svg2shenzhen_export.inx └── svg2shenzhen_prepare.inx ├── polygon ├── CMakeLists.txt ├── PolyLine.cpp ├── PolyLine.h ├── SutherlandHodgmanClipPoly.h ├── clipper.cpp ├── clipper.hpp ├── determine_if_point_inside_polygon.odt ├── math_for_graphics.cpp ├── math_for_graphics.h ├── poly2tri │ ├── common │ │ ├── shapes.cc │ │ ├── shapes.h │ │ └── utils.h │ ├── poly2tri.h │ └── sweep │ │ ├── advancing_front.cc │ │ ├── advancing_front.h │ │ ├── cdt.cc │ │ ├── cdt.h │ │ ├── sweep.cc │ │ ├── sweep.h │ │ ├── sweep_context.cc │ │ └── sweep_context.h ├── polygon_test_point_inside.cpp ├── polygon_test_point_inside.h └── polygons_defs.h ├── potrace ├── AUTHORS ├── CMakeCache.txt ├── CMakeFiles │ ├── 3.10.3 │ │ ├── CMakeCCompiler.cmake │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeSystem.cmake │ │ ├── CompilerIdC │ │ │ ├── CMakeCCompilerId.c │ │ │ └── a.out │ │ └── CompilerIdCXX │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ └── a.out │ ├── CMakeDirectoryInformation.cmake │ ├── CMakeOutput.log │ ├── Makefile.cmake │ ├── Makefile2 │ ├── TargetDirectories.txt │ ├── cmake.check_cache │ ├── feature_tests.bin │ ├── feature_tests.c │ ├── feature_tests.cxx │ ├── potrace.dir │ │ ├── CXX.includecache │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ ├── cmake_clean.cmake │ │ ├── cmake_clean_target.cmake │ │ ├── depend.internal │ │ ├── depend.make │ │ ├── flags.make │ │ ├── link.txt │ │ └── progress.make │ └── progress.marks ├── CMakeLists.txt ├── Makefile ├── auxiliary.h ├── bitmap.h ├── bitmap_io.cpp ├── bitmap_io.h ├── bitops.h ├── curve.cpp ├── curve.h ├── decompose.cpp ├── decompose.h ├── greymap.cpp ├── greymap.h ├── libpotrace.a ├── lists.h ├── platform.h ├── potrace_version.h ├── potracelib.cpp ├── potracelib.h ├── progress.h ├── render.cpp ├── render.h ├── trace.cpp └── trace.h └── src ├── CMakeCache.txt ├── CMakeLists.txt ├── Info.plist ├── Makefile ├── bitmap2cmp_gui.cpp ├── bitmap2cmp_gui_base.cpp ├── bitmap2cmp_gui_base.fbp ├── bitmap2cmp_gui_base.h ├── bitmap2component ├── bitmap2component.cpp ├── bitmap2component.h ├── bitmap2component.icns ├── bitmap2component.rc ├── build.sh ├── build_win.sh ├── lodepng.cpp ├── lodepng.h ├── main.cpp ├── myfile.txt ├── test-a.png └── test.png /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | win: circleci/windows@2.2.0 5 | 6 | jobs: 7 | build: 8 | executor: 9 | name: win/default 10 | shell: powershell.exe 11 | steps: 12 | - checkout 13 | - run: systeminfo 14 | - run: 15 | name: "Build bitmap2component [windows]" 16 | shell: bash.exe 17 | command: | 18 | choco install wget 19 | choco install make 20 | curl -O https://nuwen.net/files/mingw/mingw-17.1-without-git.exe 21 | mingw-17.1-without-git.exe -o"C:\MinGW" -y 22 | set PATH="%PATH%;c:\MinGW\bin" 23 | make 24 | ls 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .o 3 | include/boost/* 4 | *.o 5 | *.gch 6 | dist/8 7 | dist/* 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CXX=g++ 2 | CXXFLAGS=-std=c++11 3 | INCLUDES=-Iinclude -Ipolygon -Ipotrace -Isrc -I./ -IC:\MinGW\include 4 | LIBS= 5 | 6 | SOURCES:=\ 7 | common/geometry/seg.cpp \ 8 | common/geometry/shape_collisions.cpp \ 9 | common/geometry/shape.cpp \ 10 | common/geometry/shape_line_chain.cpp \ 11 | common/geometry/shape_poly_set.cpp \ 12 | common/math/math_util.cpp \ 13 | polygon/clipper.cpp \ 14 | src/main.cpp \ 15 | src/bitmap2component.cpp \ 16 | src/lodepng.cpp \ 17 | potrace/curve.cpp \ 18 | potrace/decompose.cpp \ 19 | potrace/potracelib.cpp \ 20 | potrace/trace.cpp 21 | OBJECTS:=$(patsubst %.cpp,%.o,$(SOURCES)) 22 | 23 | ifneq ($(OS),Windows_NT) 24 | OS:=$(shell uname) 25 | endif 26 | ifeq ($(OS), Windows_NT) 27 | EXESUFFIX=.exe 28 | endif 29 | 30 | BITMAP2COMPONENT:=bitmap2component$(EXESUFFIX) 31 | GIT_TAG_VERSION=$(shell git describe --tag) 32 | RELEASE_FILENAME_PREFIX=svg2shenzhen-extension 33 | DIST:=$(RELEASE_FILENAME_PREFIX)-$(GIT_TAG_VERSION).zip 34 | 35 | .PHONY: clean all package 36 | 37 | all: $(BITMAP2COMPONENT) 38 | 39 | package: $(DIST) 40 | 41 | clean: 42 | rm -f *.o common/geometry/*.p common/math/*.o polygon/*.o src/*.o potrace/*.o $(BITMAP2COMPONENT) $(DIST) 43 | 44 | %.o: %.cpp 45 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $^ -o $@ 46 | 47 | $(BITMAP2COMPONENT): $(OBJECTS) 48 | $(CXX) $(LIBS) $^ -o $@ 49 | 50 | $(DIST): 51 | zip $@ inkscape/svg2shenzhen/ 52 | sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_about.inx | zip -q $@ - 53 | /bin/echo -e '@ -\n@=inkscape/svg2shenzhen_about.inx' | zipnote -w $@ 54 | sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_export.inx | zip -q $@ - 55 | /bin/echo -e '@ -\n@=inkscape/svg2shenzhen_export.inx' | zipnote -w $@ 56 | sed s/SVGSZ_VER/${GIT_TAG_VERSION}/g < inkscape/svg2shenzhen_prepare.inx | zip -q $@ - 57 | /bin/echo -e '@ -\n@=inkscape/svg2shenzhen_prepare.inx' | zipnote -w $@ 58 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cwd=$(pwd) 4 | 5 | BUILD_DIR=dist 6 | 7 | BUILD_DIR_STAGING=staging 8 | 9 | GIT_TAG_VERSION=`git describe --tag` 10 | 11 | RELEASE_FILENAME_PREFIX=svg2shenzhen-extension 12 | # echo "$cwd/$BUILD_DIR/$BUILD_DIR_STAGING" 13 | 14 | rm -fr $cwd/$BUILD_DIR/* 15 | 16 | mkdir -p "$cwd/$BUILD_DIR/$BUILD_DIR_STAGING" 17 | 18 | cp -r inkscape/* $cwd/$BUILD_DIR/$BUILD_DIR_STAGING 19 | 20 | find $cwd/$BUILD_DIR/$BUILD_DIR_STAGING -name *.inx -type f -exec sed -i.bak s/SVGSZ_VER/${GIT_TAG_VERSION}/g '{}' \; 21 | 22 | rm -fr $cwd/$BUILD_DIR/$BUILD_DIR_STAGING/*.bak 23 | 24 | cd $cwd/$BUILD_DIR/$BUILD_DIR_STAGING 25 | 26 | tar -czvf $cwd/$BUILD_DIR/${RELEASE_FILENAME_PREFIX}-${GIT_TAG_VERSION}.tar.gz . 27 | zip -m -x .DS_Store -r $cwd/$BUILD_DIR/${RELEASE_FILENAME_PREFIX}-${GIT_TAG_VERSION}.zip . 28 | 29 | cd $cwd 30 | 31 | ls dist -------------------------------------------------------------------------------- /common/bin_mod.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014 CERN 5 | * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | BIN_MOD::BIN_MOD( const char* aName ) : 31 | m_name( aName ), 32 | m_config( 0 ) 33 | { 34 | } 35 | 36 | 37 | void BIN_MOD::Init() 38 | { 39 | // do an OS specific wxConfig instantiation, using the bin_mod (EXE/DLL/DSO) name. 40 | m_config = GetNewConfig( wxString::FromUTF8( m_name ) ); 41 | 42 | m_history.Load( *m_config ); 43 | 44 | // Prepare On Line Help. Use only lower case for help file names, in order to 45 | // avoid problems with upper/lower case file names under windows and unix. 46 | // Help files are now using html format. 47 | // Old help files used pdf format. 48 | // so when searching a help file, the .html file will be searched, 49 | // and if not found, the .pdf file will be searched. 50 | m_help_file = wxString::FromUTF8( m_name ); // no ext given. can be .html or .pdf 51 | } 52 | 53 | 54 | void BIN_MOD::End() 55 | { 56 | if( m_config ) 57 | { 58 | m_history.Save( *m_config ); 59 | 60 | // Deleting a wxConfigBase writes its contents to disk if changed. 61 | // Might be NULL if called twice, in which case nothing happens. 62 | delete m_config; 63 | m_config = 0; 64 | } 65 | } 66 | 67 | 68 | BIN_MOD::~BIN_MOD() 69 | { 70 | End(); 71 | } 72 | 73 | -------------------------------------------------------------------------------- /common/bitmap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2011 SoftPLC Corporation, Dick Hollenbeck 5 | * Copyright (C) 2011 KiCad Developers, see change_log.txt for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | 33 | wxBitmap KiBitmap( BITMAP_DEF aBitmap ) 34 | { 35 | wxMemoryInputStream is( aBitmap->png, aBitmap->byteCount ); 36 | 37 | return wxBitmap( wxImage( is, wxBITMAP_TYPE_PNG, -1 ), -1 ); 38 | } 39 | 40 | wxBitmap* KiBitmapNew( BITMAP_DEF aBitmap ) 41 | { 42 | wxMemoryInputStream is( aBitmap->png, aBitmap->byteCount ); 43 | 44 | return new wxBitmap( wxImage( is, wxBITMAP_TYPE_PNG, -1 ), -1 ); 45 | } 46 | -------------------------------------------------------------------------------- /common/build_version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr 5 | * Copyright (C) 2015-2016 KiCad Developers, see AUTHORS.txt for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | // Date for KiCad build version 26 | #include 27 | 28 | // The include file version.h is always created even if the repo version cannot be 29 | // determined. In this case KICAD_BUILD_VERSION will default to "no-bzr". 30 | #include 31 | 32 | 33 | /** 34 | * Function GetBuildVersion 35 | * Return the build version string. 36 | */ 37 | wxString GetBuildVersion() 38 | { 39 | wxString msg = wxString::Format( 40 | wxT( "%s" ), 41 | wxT( KICAD_VERSION_FULL ) 42 | ); 43 | 44 | return msg; 45 | } 46 | -------------------------------------------------------------------------------- /common/dialog_about/dialog_about_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 5 2014) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_ABOUT_BASE_H__ 9 | #define __DIALOG_ABOUT_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | /////////////////////////////////////////////////////////////////////////// 31 | 32 | /////////////////////////////////////////////////////////////////////////////// 33 | /// Class dialog_about_base 34 | /////////////////////////////////////////////////////////////////////////////// 35 | class dialog_about_base : public wxDialog 36 | { 37 | private: 38 | 39 | protected: 40 | wxStaticBitmap* m_bitmapApp; 41 | wxStaticText* m_staticTextAppTitle; 42 | wxStaticText* m_staticTextCopyright; 43 | wxStaticText* m_staticTextBuildVersion; 44 | wxStaticText* m_staticTextLibVersion; 45 | wxAuiNotebook* m_auiNotebook; 46 | wxStdDialogButtonSizer* m_sdbSizer; 47 | wxButton* m_sdbSizerOK; 48 | 49 | public: 50 | 51 | dialog_about_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,437 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP ); 52 | ~dialog_about_base(); 53 | 54 | }; 55 | 56 | #endif //__DIALOG_ABOUT_BASE_H__ 57 | -------------------------------------------------------------------------------- /common/dialogs/dialog_display_info_HTML_base.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Nov 5 2013) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #include "dialog_display_info_HTML_base.h" 9 | 10 | /////////////////////////////////////////////////////////////////////////// 11 | 12 | DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) 13 | { 14 | this->SetSizeHints( wxSize( 400,120 ), wxDefaultSize ); 15 | 16 | wxBoxSizer* bMainSizer; 17 | bMainSizer = new wxBoxSizer( wxVERTICAL ); 18 | 19 | m_htmlWindow = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER ); 20 | bMainSizer->Add( m_htmlWindow, 1, wxEXPAND, 5 ); 21 | 22 | m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); 23 | m_buttonClose->SetDefault(); 24 | bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxALL, 10 ); 25 | 26 | 27 | this->SetSizer( bMainSizer ); 28 | this->Layout(); 29 | 30 | // Connect Events 31 | m_htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this ); 32 | m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this ); 33 | } 34 | 35 | DIALOG_DISPLAY_HTML_TEXT_BASE::~DIALOG_DISPLAY_HTML_TEXT_BASE() 36 | { 37 | // Disconnect Events 38 | m_htmlWindow->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this ); 39 | m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this ); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /common/dialogs/dialog_display_info_HTML_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Nov 5 2013) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_DISPLAY_INFO_HTML_BASE_H__ 9 | #define __DIALOG_DISPLAY_INFO_HTML_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | class DIALOG_SHIM; 15 | 16 | #include "dialog_shim.h" 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | 30 | /////////////////////////////////////////////////////////////////////////////// 31 | /// Class DIALOG_DISPLAY_HTML_TEXT_BASE 32 | /////////////////////////////////////////////////////////////////////////////// 33 | class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM 34 | { 35 | private: 36 | 37 | protected: 38 | wxButton* m_buttonClose; 39 | 40 | // Virtual event handlers, overide them in your derived class 41 | virtual void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); } 42 | virtual void OnCloseButtonClick( wxCommandEvent& event ) { event.Skip(); } 43 | 44 | 45 | public: 46 | wxHtmlWindow* m_htmlWindow; 47 | 48 | DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 465,202 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 49 | ~DIALOG_DISPLAY_HTML_TEXT_BASE(); 50 | 51 | }; 52 | 53 | #endif //__DIALOG_DISPLAY_INFO_HTML_BASE_H__ 54 | -------------------------------------------------------------------------------- /common/dialogs/dialog_env_var_config_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 17 2015) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_ENV_VAR_CONFIG_BASE_H__ 9 | #define __DIALOG_ENV_VAR_CONFIG_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | class DIALOG_SHIM; 15 | 16 | #include "dialog_shim.h" 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | /////////////////////////////////////////////////////////////////////////// 29 | 30 | 31 | /////////////////////////////////////////////////////////////////////////////// 32 | /// Class DIALOG_ENV_VAR_CONFIG_BASE 33 | /////////////////////////////////////////////////////////////////////////////// 34 | class DIALOG_ENV_VAR_CONFIG_BASE : public DIALOG_SHIM 35 | { 36 | private: 37 | 38 | protected: 39 | wxGrid* m_grid; 40 | wxButton* m_buttonAdd; 41 | wxButton* m_buttonDelete; 42 | wxStaticLine* m_staticline1; 43 | wxStdDialogButtonSizer* m_sdbSizer; 44 | wxButton* m_sdbSizerOK; 45 | wxButton* m_sdbSizerCancel; 46 | wxButton* m_sdbSizerHelp; 47 | 48 | // Virtual event handlers, overide them in your derived class 49 | virtual void OnAddRow( wxCommandEvent& event ) { event.Skip(); } 50 | virtual void OnDeleteSelectedRows( wxCommandEvent& event ) { event.Skip(); } 51 | virtual void OnHelpRequest( wxCommandEvent& event ) { event.Skip(); } 52 | 53 | 54 | public: 55 | 56 | DIALOG_ENV_VAR_CONFIG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Path Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 363,177 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 57 | ~DIALOG_ENV_VAR_CONFIG_BASE(); 58 | 59 | }; 60 | 61 | #endif //__DIALOG_ENV_VAR_CONFIG_BASE_H__ 62 | -------------------------------------------------------------------------------- /common/dialogs/dialog_exit_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Oct 8 2012) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_EXIT_BASE_H__ 9 | #define __DIALOG_EXIT_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | class DIALOG_SHIM; 15 | 16 | #include "dialog_shim.h" 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | /////////////////////////////////////////////////////////////////////////// 33 | 34 | 35 | /////////////////////////////////////////////////////////////////////////////// 36 | /// Class DIALOG_EXIT_BASE 37 | /////////////////////////////////////////////////////////////////////////////// 38 | class DIALOG_EXIT_BASE : public DIALOG_SHIM 39 | { 40 | private: 41 | 42 | protected: 43 | wxStaticBitmap* m_bitmap; 44 | wxStaticText* m_TextInfo; 45 | wxStaticText* m_staticText2; 46 | wxStaticLine* m_staticline; 47 | wxButton* m_buttonSaveAndExit; 48 | wxButton* m_buttonExitNoSave; 49 | wxButton* m_buttonCancel; 50 | 51 | // Virtual event handlers, overide them in your derived class 52 | virtual void OnSaveAndExit( wxCommandEvent& event ) { event.Skip(); } 53 | virtual void OnExitNoSave( wxCommandEvent& event ) { event.Skip(); } 54 | virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } 55 | 56 | 57 | public: 58 | 59 | DIALOG_EXIT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 60 | ~DIALOG_EXIT_BASE(); 61 | 62 | }; 63 | 64 | #endif //__DIALOG_EXIT_BASE_H__ 65 | -------------------------------------------------------------------------------- /common/dialogs/dialog_get_component_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Nov 5 2013) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_GET_COMPONENT_BASE_H__ 9 | #define __DIALOG_GET_COMPONENT_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | class DIALOG_SHIM; 15 | 16 | #include "dialog_shim.h" 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | /////////////////////////////////////////////////////////////////////////// 30 | 31 | #define ID_SEL_BY_LISTBOX 1000 32 | #define ID_ACCEPT_KEYWORD 1001 33 | #define ID_LIST_ALL 1002 34 | #define ID_EXTRA_TOOL 1003 35 | 36 | /////////////////////////////////////////////////////////////////////////////// 37 | /// Class DIALOG_GET_COMPONENT_BASE 38 | /////////////////////////////////////////////////////////////////////////////// 39 | class DIALOG_GET_COMPONENT_BASE : public DIALOG_SHIM 40 | { 41 | private: 42 | 43 | protected: 44 | wxStaticText* m_staticTextName; 45 | wxTextCtrl* m_textCmpNameCtrl; 46 | wxStaticText* m_staticTextHistory; 47 | wxListBox* m_historyList; 48 | wxButton* m_buttonOK; 49 | wxButton* m_buttonKW; 50 | wxButton* m_buttonCancel; 51 | wxButton* m_buttonList; 52 | wxButton* m_buttonBrowse; 53 | 54 | // Virtual event handlers, overide them in your derived class 55 | virtual void Accept( wxCommandEvent& event ) { event.Skip(); } 56 | virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } 57 | virtual void GetExtraSelection( wxCommandEvent& event ) { event.Skip(); } 58 | 59 | 60 | public: 61 | 62 | DIALOG_GET_COMPONENT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 63 | ~DIALOG_GET_COMPONENT_BASE(); 64 | 65 | }; 66 | 67 | #endif //__DIALOG_GET_COMPONENT_BASE_H__ 68 | -------------------------------------------------------------------------------- /common/dialogs/dialog_hotkeys_editor_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 17 2015) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_HOTKEYS_EDITOR_BASE_H__ 9 | #define __DIALOG_HOTKEYS_EDITOR_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | class DIALOG_SHIM; 15 | 16 | #include "dialog_shim.h" 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | /////////////////////////////////////////////////////////////////////////// 29 | 30 | 31 | /////////////////////////////////////////////////////////////////////////////// 32 | /// Class HOTKEYS_EDITOR_DIALOG_BASE 33 | /////////////////////////////////////////////////////////////////////////////// 34 | class HOTKEYS_EDITOR_DIALOG_BASE : public DIALOG_SHIM 35 | { 36 | private: 37 | 38 | protected: 39 | wxStaticText* m_staticText1; 40 | wxNotebook* m_hotkeySections; 41 | wxStdDialogButtonSizer* m_sdbSizer; 42 | wxButton* m_sdbSizerOK; 43 | wxButton* m_sdbSizerCancel; 44 | wxButton* m_undoButton; 45 | 46 | // Virtual event handlers, overide them in your derived class 47 | virtual void OnOKClicked( wxCommandEvent& event ) { event.Skip(); } 48 | virtual void UndoClicked( wxCommandEvent& event ) { event.Skip(); } 49 | 50 | 51 | public: 52 | 53 | HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hotkeys Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 450,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 54 | ~HOTKEYS_EDITOR_DIALOG_BASE(); 55 | 56 | }; 57 | 58 | #endif //__DIALOG_HOTKEYS_EDITOR_BASE_H__ 59 | -------------------------------------------------------------------------------- /common/dialogs/dialog_list_selector_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 5 2014) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __DIALOG_LIST_SELECTOR_BASE_H__ 9 | #define __DIALOG_LIST_SELECTOR_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | class DIALOG_SHIM; 15 | 16 | #include "dialog_shim.h" 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | /////////////////////////////////////////////////////////////////////////// 30 | 31 | 32 | /////////////////////////////////////////////////////////////////////////////// 33 | /// Class EDA_LIST_DIALOG_BASE 34 | /////////////////////////////////////////////////////////////////////////////// 35 | class EDA_LIST_DIALOG_BASE : public DIALOG_SHIM 36 | { 37 | private: 38 | 39 | protected: 40 | wxStaticText* m_filterLabel; 41 | wxTextCtrl* m_filterBox; 42 | wxStaticText* m_staticText2; 43 | wxListCtrl* m_listBox; 44 | wxStaticText* m_staticTextMsg; 45 | wxTextCtrl* m_messages; 46 | wxStdDialogButtonSizer* m_sdbSizer; 47 | wxButton* m_sdbSizerOK; 48 | wxButton* m_sdbSizerCancel; 49 | 50 | // Virtual event handlers, overide them in your derived class 51 | virtual void onClose( wxCloseEvent& event ) = 0; 52 | virtual void textChangeInFilterBox( wxCommandEvent& event ) = 0; 53 | virtual void onListItemActivated( wxListEvent& event ) = 0; 54 | virtual void onListItemSelected( wxListEvent& event ) = 0; 55 | virtual void onCancelClick( wxCommandEvent& event ) = 0; 56 | virtual void onOkClick( wxCommandEvent& event ) = 0; 57 | 58 | 59 | public: 60 | 61 | EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,400 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 62 | ~EDA_LIST_DIALOG_BASE(); 63 | 64 | }; 65 | 66 | #endif //__DIALOG_LIST_SELECTOR_BASE_H__ 67 | -------------------------------------------------------------------------------- /common/dialogs/wx_html_report_panel_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // C++ code generated with wxFormBuilder (version Jun 17 2015) 3 | // http://www.wxformbuilder.org/ 4 | // 5 | // PLEASE DO "NOT" EDIT THIS FILE! 6 | /////////////////////////////////////////////////////////////////////////// 7 | 8 | #ifndef __WX_HTML_REPORT_PANEL_BASE_H__ 9 | #define __WX_HTML_REPORT_PANEL_BASE_H__ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | /////////////////////////////////////////////////////////////////////////// 28 | 29 | 30 | /////////////////////////////////////////////////////////////////////////////// 31 | /// Class WX_HTML_REPORT_PANEL_BASE 32 | /////////////////////////////////////////////////////////////////////////////// 33 | class WX_HTML_REPORT_PANEL_BASE : public wxPanel 34 | { 35 | private: 36 | 37 | protected: 38 | wxStaticBoxSizer* m_box; 39 | wxHtmlWindow* m_htmlView; 40 | wxStaticText* m_staticText3; 41 | wxCheckBox* m_checkBoxShowAll; 42 | wxCheckBox* m_checkBoxShowWarnings; 43 | wxCheckBox* m_checkBoxShowErrors; 44 | wxCheckBox* m_checkBoxShowInfos; 45 | wxCheckBox* m_checkBoxShowActions; 46 | wxButton* m_btnSaveReportToFile; 47 | 48 | // Virtual event handlers, overide them in your derived class 49 | virtual void onCheckBoxShowAll( wxCommandEvent& event ) { event.Skip(); } 50 | virtual void onCheckBoxShowWarnings( wxCommandEvent& event ) { event.Skip(); } 51 | virtual void onCheckBoxShowErrors( wxCommandEvent& event ) { event.Skip(); } 52 | virtual void onCheckBoxShowInfos( wxCommandEvent& event ) { event.Skip(); } 53 | virtual void onCheckBoxShowActions( wxCommandEvent& event ) { event.Skip(); } 54 | virtual void onBtnSaveToFile( wxCommandEvent& event ) { event.Skip(); } 55 | 56 | 57 | public: 58 | 59 | WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL ); 60 | ~WX_HTML_REPORT_PANEL_BASE(); 61 | 62 | }; 63 | 64 | #endif //__WX_HTML_REPORT_PANEL_BASE_H__ 65 | -------------------------------------------------------------------------------- /common/fp_lib_table.keywords: -------------------------------------------------------------------------------- 1 | fp_lib_table 2 | lib 3 | name 4 | type 5 | uri 6 | options 7 | descr 8 | -------------------------------------------------------------------------------- /common/gal/opengl/shader.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KICAD, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2013 CERN 5 | * @author Maciej Suminski 6 | * 7 | * Fragment shader 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, you may find one here: 21 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 | * or you may search the http://www.gnu.org website for the version 2 license, 23 | * or you may write to the Free Software Foundation, Inc., 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 25 | */ 26 | 27 | #version 120 28 | 29 | // Shader types 30 | const float SHADER_LINE = 1.0; 31 | const float SHADER_FILLED_CIRCLE = 2.0; 32 | const float SHADER_STROKED_CIRCLE = 3.0; 33 | 34 | varying vec4 shaderParams; 35 | varying vec2 circleCoords; 36 | 37 | void filledCircle( vec2 aCoord ) 38 | { 39 | if( dot( aCoord, aCoord ) < 1.0 ) 40 | gl_FragColor = gl_Color; 41 | else 42 | discard; 43 | } 44 | 45 | 46 | void strokedCircle( vec2 aCoord, float aRadius, float aWidth ) 47 | { 48 | float outerRadius = aRadius + ( aWidth / 2 ); 49 | float innerRadius = aRadius - ( aWidth / 2 ); 50 | float relWidth = innerRadius / outerRadius; 51 | 52 | if( ( dot( aCoord, aCoord ) < 1.0 ) && 53 | ( dot( aCoord, aCoord ) > relWidth * relWidth ) ) 54 | gl_FragColor = gl_Color; 55 | else 56 | discard; 57 | } 58 | 59 | 60 | void main() 61 | { 62 | if( shaderParams[0] == SHADER_FILLED_CIRCLE ) 63 | { 64 | filledCircle( circleCoords ); 65 | } 66 | else if( shaderParams[0] == SHADER_STROKED_CIRCLE ) 67 | { 68 | strokedCircle( circleCoords, shaderParams[2], shaderParams[3] ); 69 | } 70 | else 71 | { 72 | // Simple pass-through 73 | gl_FragColor = gl_Color; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /common/gal/opengl/vertex_container.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2013 CERN 5 | * @author Maciej Suminski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /** 26 | * @file vertex_container.cpp 27 | * @brief Class to store vertices and handle transfers between system memory and GPU memory. 28 | */ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | using namespace KIGFX; 38 | 39 | VERTEX_CONTAINER* VERTEX_CONTAINER::MakeContainer( bool aCached ) 40 | { 41 | if( aCached ) 42 | return new CACHED_CONTAINER; 43 | else 44 | return new NONCACHED_CONTAINER; 45 | } 46 | 47 | 48 | VERTEX_CONTAINER::VERTEX_CONTAINER( unsigned int aSize ) : 49 | m_freeSpace( aSize ), m_currentSize( aSize ), m_initialSize( aSize ), 50 | m_failed( false ), m_dirty( true ) 51 | { 52 | m_vertices = static_cast( malloc( aSize * sizeof( VERTEX ) ) ); 53 | memset( m_vertices, 0x00, aSize * sizeof( VERTEX ) ); 54 | } 55 | 56 | 57 | VERTEX_CONTAINER::~VERTEX_CONTAINER() 58 | { 59 | free( m_vertices ); 60 | } 61 | -------------------------------------------------------------------------------- /common/gal/opengl/vertex_item.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2013 CERN 5 | * @author Maciej Suminski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /** 26 | * @file vertex_item.cpp 27 | * @brief Class to handle an item held in a container. 28 | */ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | using namespace KIGFX; 35 | 36 | VERTEX_ITEM::VERTEX_ITEM( const VERTEX_MANAGER& aManager ) : 37 | m_manager( aManager ), m_offset( 0 ), m_size( 0 ) 38 | { 39 | // As the item is created, we are going to modify it, so call to SetItem() is needed 40 | m_manager.SetItem( *this ); 41 | } 42 | 43 | 44 | VERTEX_ITEM::~VERTEX_ITEM() 45 | { 46 | m_manager.FreeItem( *this ); 47 | } 48 | 49 | 50 | VERTEX* VERTEX_ITEM::GetVertices() const 51 | { 52 | return m_manager.GetVertices( *this ); 53 | } 54 | -------------------------------------------------------------------------------- /common/geometry/shape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2015 CERN 5 | * @author Tomasz Wlostowski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | 26 | #include 27 | 28 | bool SHAPE::Parse( std::stringstream& aStream ) 29 | { 30 | assert ( false ); 31 | return false; 32 | }; 33 | 34 | const std::string SHAPE::Format( ) const 35 | { 36 | assert ( false ); 37 | return std::string(""); 38 | }; 39 | -------------------------------------------------------------------------------- /common/kiway_holder.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #if defined(DEBUG) 6 | #include 7 | #endif 8 | 9 | 10 | PROJECT& KIWAY_HOLDER::Prj() const 11 | { 12 | return Kiway().Prj(); 13 | } 14 | 15 | 16 | // this is not speed critical, hide it out of line. 17 | void KIWAY_HOLDER::SetKiway( wxWindow* aDest, KIWAY* aKiway ) 18 | { 19 | #if defined(DEBUG) 20 | // offer a trap point for debugging most any window 21 | wxASSERT( aDest ); 22 | if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) ) 23 | { 24 | int breakhere=1; 25 | (void) breakhere; 26 | } 27 | #endif 28 | 29 | (void) aDest; 30 | 31 | m_kiway = aKiway; 32 | } 33 | -------------------------------------------------------------------------------- /common/lockfile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014-2015 SoftPLC Corporation, Dick Hollenbeck 5 | * Copyright (C) 2014-2015 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | wxSingleInstanceChecker* LockFile( const wxString& aFileName ) 31 | { 32 | // first make absolute and normalize, to avoid that different lock files 33 | // for the same file can be created 34 | wxFileName fn( aFileName ); 35 | 36 | fn.MakeAbsolute(); 37 | 38 | wxString lockFileName = fn.GetFullPath() + wxT( ".lock" ); 39 | 40 | lockFileName.Replace( wxT( "/" ), wxT( "_" ) ); 41 | 42 | // We can have filenames coming from Windows, so also convert Windows separator 43 | lockFileName.Replace( wxT( "\\" ), wxT( "_" ) ); 44 | 45 | wxSingleInstanceChecker* p = new wxSingleInstanceChecker( lockFileName, 46 | GetKicadLockFilePath() ); 47 | 48 | if( p->IsAnotherRunning() ) 49 | { 50 | delete p; 51 | p = NULL; 52 | } 53 | 54 | return p; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /common/netlist.keywords: -------------------------------------------------------------------------------- 1 | code 2 | comp 3 | components 4 | datasheet 5 | date 6 | description 7 | design 8 | docs 9 | export 10 | field 11 | fields 12 | footprint 13 | footprints 14 | fp 15 | lib 16 | libpart 17 | libparts 18 | libraries 19 | library 20 | libsource 21 | name 22 | names 23 | net 24 | nets 25 | node 26 | num 27 | part 28 | pin 29 | pins 30 | ref 31 | sheetpath 32 | source 33 | tool 34 | tstamp 35 | tstamps 36 | uri 37 | value 38 | version 39 | aliases 40 | alias 41 | -------------------------------------------------------------------------------- /common/page_layout/page_layout_reader.keywords: -------------------------------------------------------------------------------- 1 | page_layout 2 | setup 3 | left_margin 4 | right_margin 5 | top_margin 6 | bottom_margin 7 | linewidth 8 | textlinewidth 9 | textsize 10 | comment 11 | option 12 | page1only 13 | notonpage1 14 | line 15 | rect 16 | polygon 17 | bitmap 18 | tbtext 19 | ltcorner 20 | lbcorner 21 | rbcorner 22 | rtcorner 23 | name 24 | pos 25 | start 26 | end 27 | scale 28 | pngdata 29 | data 30 | pts 31 | xy 32 | maxlen 33 | maxheight 34 | font 35 | bold 36 | italic 37 | size 38 | justify 39 | left 40 | center 41 | right 42 | top 43 | bottom 44 | rotate 45 | repeat 46 | incrx 47 | incry 48 | incrlabel 49 | -------------------------------------------------------------------------------- /common/pcb_plot_params.keywords: -------------------------------------------------------------------------------- 1 | drillshape 2 | excludeedgelayer 3 | false 4 | gerberprecision 5 | hpglpendiameter 6 | hpglpennumber 7 | hpglpenoverlay 8 | hpglpenspeed 9 | layerselection 10 | linewidth 11 | mirror 12 | mode 13 | outputdirectory 14 | outputformat 15 | padsonsilk 16 | pcbplotparams 17 | plotframeref 18 | plotinvisibletext 19 | plotreference 20 | plotvalue 21 | psa4output 22 | pscolor 23 | psnegative 24 | scaleselection 25 | subtractmaskfromsilk 26 | true 27 | useauxorigin 28 | usegerberextensions 29 | viasonmask 30 | usegerberattributes 31 | -------------------------------------------------------------------------------- /common/prependpath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014 CERN 5 | * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * @author Maciej Suminski 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, you may find one here: 20 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 | * or you may search the http://www.gnu.org website for the version 2 license, 22 | * or you may write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | /// Put aPriorityPath in front of all paths in the value of aEnvVar. 32 | const wxString PrePendPath( const wxString& aEnvVar, const wxString& aPriorityPath ) 33 | { 34 | wxPathList paths; 35 | 36 | paths.AddEnvList( aEnvVar ); 37 | paths.Insert( aPriorityPath, 0 ); 38 | 39 | return wxJoin( paths, wxPATH_SEP[0] ); 40 | } 41 | -------------------------------------------------------------------------------- /common/strtok_r.c: -------------------------------------------------------------------------------- 1 | /* 2 | * public domain strtok_r() 3 | */ 4 | 5 | #include 6 | 7 | char* strtok_r( char* str, const char* delim, char** nextp ) 8 | { 9 | char* ret; 10 | 11 | if( str == NULL ) 12 | { 13 | str = *nextp; 14 | } 15 | 16 | str += strspn( str, delim ); 17 | 18 | if( *str == '\0' ) 19 | { 20 | return NULL; 21 | } 22 | 23 | ret = str; 24 | 25 | str += strcspn( str, delim ); 26 | 27 | if( *str ) 28 | { 29 | *str++ = '\0'; 30 | } 31 | 32 | *nextp = str; 33 | 34 | return ret; 35 | } 36 | -------------------------------------------------------------------------------- /common/tool/tool_action.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2013 CERN 5 | * @author Maciej Suminski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | TOOL_ACTION::TOOL_ACTION( const std::string& aName, TOOL_ACTION_SCOPE aScope, 29 | int aDefaultHotKey, const wxString aMenuItem, const wxString& aMenuDesc, 30 | const BITMAP_OPAQUE* aIcon, TOOL_ACTION_FLAGS aFlags, void* aParam ) : 31 | m_name( aName ), m_scope( aScope ), m_defaultHotKey( aDefaultHotKey ), 32 | m_menuItem( aMenuItem ), m_menuDescription( aMenuDesc ), 33 | m_icon( aIcon ), m_id( -1 ), m_flags( aFlags ), m_param( aParam ) 34 | { 35 | ACTION_MANAGER::GetActionList().push_back( this ); 36 | } 37 | 38 | 39 | TOOL_ACTION::~TOOL_ACTION() 40 | { 41 | ACTION_MANAGER::GetActionList().remove( this ); 42 | } 43 | 44 | 45 | std::string TOOL_ACTION::GetToolName() const 46 | { 47 | int dotCount = std::count( m_name.begin(), m_name.end(), '.' ); 48 | 49 | switch( dotCount ) 50 | { 51 | case 0: 52 | assert( false ); // Invalid action name format 53 | return ""; 54 | 55 | case 1: 56 | return m_name; 57 | 58 | case 2: 59 | return m_name.substr( 0, m_name.rfind( '.' ) ); 60 | 61 | default: 62 | assert( false ); // TODO not implemented 63 | return ""; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /common/tool/tool_interactive.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2013 CERN 5 | * @author Tomasz Wlostowski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | TOOL_INTERACTIVE::TOOL_INTERACTIVE( TOOL_ID aId, const std::string& aName ) : 33 | TOOL_BASE( INTERACTIVE, aId, aName ) 34 | { 35 | } 36 | 37 | 38 | TOOL_INTERACTIVE::TOOL_INTERACTIVE( const std::string& aName ) : 39 | TOOL_BASE( INTERACTIVE, TOOL_MANAGER::MakeToolId( aName ), aName ) 40 | { 41 | } 42 | 43 | 44 | TOOL_INTERACTIVE::~TOOL_INTERACTIVE() 45 | { 46 | } 47 | 48 | 49 | void TOOL_INTERACTIVE::Activate() 50 | { 51 | m_toolMgr->InvokeTool( m_toolId ); 52 | } 53 | 54 | 55 | OPT_TOOL_EVENT TOOL_INTERACTIVE::Wait( const TOOL_EVENT_LIST& aEventList ) 56 | { 57 | return m_toolMgr->ScheduleWait( this, aEventList ); 58 | } 59 | 60 | 61 | void TOOL_INTERACTIVE::goInternal( TOOL_STATE_FUNC& aState, const TOOL_EVENT_LIST& aConditions ) 62 | { 63 | m_toolMgr->ScheduleNextState( this, aState, aConditions ); 64 | } 65 | 66 | 67 | void TOOL_INTERACTIVE::SetContextMenu( CONTEXT_MENU* aMenu, CONTEXT_MENU_TRIGGER aTrigger ) 68 | { 69 | if( aMenu ) 70 | aMenu->SetTool( this ); 71 | 72 | m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger ); 73 | } 74 | -------------------------------------------------------------------------------- /common/view/view_controls.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2012 Torsten Hueter, torstenhtr gmx.de 5 | * Copyright (C) 2013-2015 CERN 6 | * @author Tomasz Wlostowski 7 | * @author Maciej Suminski 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, you may find one here: 21 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 | * or you may search the http://www.gnu.org website for the version 2 license, 23 | * or you may write to the Free Software Foundation, Inc., 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | using namespace KIGFX; 32 | 33 | void VIEW_CONTROLS::ShowCursor( bool aEnabled ) 34 | { 35 | m_view->GetGAL()->SetCursorEnabled( aEnabled ); 36 | } 37 | 38 | 39 | void VIEW_CONTROLS::Reset() 40 | { 41 | SetSnapping( false ); 42 | SetAutoPan( false ); 43 | ForceCursorPosition( false ); 44 | ShowCursor( false ); 45 | CaptureCursor( false ); 46 | SetGrabMouse( false ); 47 | } 48 | -------------------------------------------------------------------------------- /common/wx_status_popup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014-2015 CERN 5 | * Author: Tomasz Wlostowski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /** 26 | * Transient mouse following popup window implementation. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | WX_STATUS_POPUP::WX_STATUS_POPUP( PCB_EDIT_FRAME* aParent ) : 33 | wxPopupWindow( aParent ) 34 | { 35 | m_panel = new wxPanel( this, wxID_ANY ); 36 | m_panel->SetBackgroundColour( *wxLIGHT_GREY ); 37 | 38 | m_topSizer = new wxBoxSizer( wxVERTICAL ); 39 | m_panel->SetSizer( m_topSizer ); 40 | } 41 | 42 | 43 | void WX_STATUS_POPUP::updateSize() 44 | { 45 | m_topSizer->Fit( m_panel ); 46 | SetClientSize( m_panel->GetSize() ); 47 | } 48 | 49 | 50 | WX_STATUS_POPUP::~WX_STATUS_POPUP() 51 | { 52 | } 53 | 54 | 55 | void WX_STATUS_POPUP::Popup( wxWindow* ) 56 | { 57 | Show( true ); 58 | Raise(); 59 | } 60 | 61 | 62 | void WX_STATUS_POPUP::Move( const wxPoint& aWhere ) 63 | { 64 | SetPosition ( aWhere ); 65 | } 66 | -------------------------------------------------------------------------------- /doc/resources/showcase.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/doc/resources/showcase.jpeg -------------------------------------------------------------------------------- /doc/resources/windows_step_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/doc/resources/windows_step_0.png -------------------------------------------------------------------------------- /doc/resources/windows_step_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/doc/resources/windows_step_1.png -------------------------------------------------------------------------------- /doc/resources/windows_step_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/doc/resources/windows_step_2.png -------------------------------------------------------------------------------- /doc/resources/windows_step_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/doc/resources/windows_step_3.png -------------------------------------------------------------------------------- /examples/myFirstPCB_comboScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/examples/myFirstPCB_comboScreen.png -------------------------------------------------------------------------------- /include/bezier_curves.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2009-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #ifndef BEZIER_CURVES_H 26 | #define BEZIER_CURVES_H 27 | 28 | #include 29 | 30 | #include 31 | 32 | 33 | /** 34 | * Function Bezier2Poly 35 | * convert a Bezier curve to a polyline 36 | * @param c1 - First point to convert. 37 | * @param c2 - Second point to convert. 38 | * @param c3 - Third point to convert. 39 | * @return a std::vector containing the points of the polyline 40 | */ 41 | std::vector Bezier2Poly(wxPoint c1, wxPoint c2, wxPoint c3); 42 | 43 | std::vector Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3); 44 | 45 | /** 46 | * Function Bezier2Poly 47 | * convert a Bezier curve to a polyline 48 | * @return a std::vector containing the points of the polyline 49 | * @param c1 - First point to convert. 50 | * @param c2 - Second point to convert. 51 | * @param c3 - Third point to convert. 52 | * @param c4 - Fourth point to convert. 53 | * @return a std::vector containing the points of the polyline 54 | */ 55 | std::vector Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3,wxPoint c4 ); 56 | 57 | std::vector Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); 58 | 59 | 60 | #endif // BEZIER_CURVES_H 61 | -------------------------------------------------------------------------------- /include/bin_mod.h: -------------------------------------------------------------------------------- 1 | #ifndef BIN_MOD_H_ 2 | #define BIN_MOD_H_ 3 | 4 | /* 5 | * This program source code file is part of KiCad, a free EDA CAD application. 6 | * 7 | * Copyright (C) 2014 KiCad Developers, see AUTHORS.txt for contributors. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, you may find one here: 21 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 | * or you may search the http://www.gnu.org website for the version 2 license, 23 | * or you may write to the Free Software Foundation, Inc., 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 25 | */ 26 | 27 | #if 0 28 | #include // wx 3.0: 29 | #else 30 | #include 31 | #endif 32 | 33 | #include 34 | 35 | #include 36 | 37 | class wxConfigBase; 38 | 39 | /** 40 | * Struct BIN_MOD 41 | * pertains to a single program module, either an EXE or a DSO/DLL ("bin_mod"). 42 | * It manages miscellaneous configuration file information pertinent to one bin_mod. 43 | * Because it serves in both DSO/DLLs and in EXEs, its name is neutral. 44 | *

45 | * Accessors are in containing (wrapper) classes. 46 | */ 47 | struct BIN_MOD 48 | { 49 | BIN_MOD( const char* aName ); 50 | ~BIN_MOD(); 51 | 52 | void Init(); 53 | void End(); 54 | 55 | const char* m_name; ///< name of this binary module, static C string. 56 | 57 | wxConfigBase* m_config; ///< maybe from $HOME/.${m_name} 58 | wxFileHistory m_history; 59 | wxString m_help_file; 60 | 61 | SEARCH_STACK m_search; 62 | 63 | 64 | }; 65 | 66 | #endif // BIN_MOD_H_ 67 | -------------------------------------------------------------------------------- /include/build_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /* Date for kicad build version */ 26 | 27 | #ifndef KICAD_BUILD_VERSION_H 28 | #define KICAD_BUILD_VERSION_H 29 | 30 | class wxString; 31 | 32 | 33 | /** 34 | * Function GetBuildVersion 35 | * Return the build date and version 36 | */ 37 | wxString GetBuildVersion(); 38 | 39 | #endif // KICAD_BUILD_VERSION_H 40 | -------------------------------------------------------------------------------- /include/class_macros_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2011-2014 Andrey Fedorushkov 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #ifndef _CLASS_MACROS_RECORD_H 26 | #define _CLASS_MACROS_RECORD_H 27 | 28 | #include 29 | 30 | class MACROS_RECORD 31 | { 32 | public: 33 | int m_HotkeyCode; 34 | int m_Idcommand; 35 | wxPoint m_Position; 36 | }; 37 | 38 | class MACROS_RECORDED 39 | { 40 | public: 41 | wxPoint m_StartPosition; 42 | std::list m_Record; 43 | }; 44 | 45 | #endif // _CLASS_MACROS_RECORD_H 46 | -------------------------------------------------------------------------------- /include/colors_selection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2010-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /* colors_selection.h */ 26 | 27 | #ifndef _COLORS_SELECTION_H_ 28 | #define _COLORS_SELECTION_H_ 29 | 30 | #include 31 | // Colors for layers and items 32 | extern COLORS_DESIGN_SETTINGS g_ColorsSettings; 33 | 34 | #endif // _COLORS_SELECTION_H_ 35 | -------------------------------------------------------------------------------- /include/config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/include/config.h -------------------------------------------------------------------------------- /include/convert_from_iu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2012 CERN 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, you may find one here: 18 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 | * or you may search the http://www.gnu.org website for the version 2 license, 20 | * or you may write to the Free Software Foundation, Inc., 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 22 | */ 23 | 24 | /** 25 | * @file convert_from_iu.h 26 | * @brief Definitions and functions to convert from internal units to user units 27 | * depending upon the application and/or build options. 28 | */ 29 | 30 | 31 | #ifndef _CONVERT_FROM_IU_ 32 | #define _CONVERT_FROM_IU_ 33 | 34 | 35 | /// Convert from internal units to user units. 36 | #if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW) 37 | #if defined(GERBVIEW) 38 | #define MM_PER_IU 1.0 / 1e5 // Gerbview uses 10 micrometer. 39 | #else 40 | #define MM_PER_IU 1.0 / 1e6 // Pcbnew in nanometers. 41 | #endif 42 | #define MILS_PER_IU ( MM_PER_IU * 0.0254 ) 43 | #define DECIMILS_PER_IU (MM_PER_IU * 0.00254 ) 44 | 45 | /// Convert PCBNEW internal units (iu) to mils. 46 | inline int Iu2Mils( int iu ) 47 | { 48 | double x = iu * MILS_PER_IU; 49 | return int( x < 0 ? x - 0.5 : x + 0.5 ); 50 | } 51 | 52 | /// Convert PCBNEW internal units (iu) to deci-mils. 53 | inline int Iu2DMils( int iu ) 54 | { 55 | double x = iu * DECIMILS_PER_IU; 56 | return int( x < 0 ? x - 0.5 : x + 0.5 ); 57 | } 58 | 59 | #else // Eeschema and anything else. 60 | #define MILS_PER_IU 1.0 61 | #define MM_PER_IU (MILS_PER_IU / 0.0254) 62 | 63 | inline int Iu2Mils( int iu ) 64 | { 65 | return iu; 66 | } 67 | #endif 68 | 69 | #endif // #define _CONVERT_FROM_IU_ 70 | -------------------------------------------------------------------------------- /include/dialog_env_var_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KICAD, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2015 Wayne Stambaugh 5 | * Copyright (C) 2015 Kicad Developers, see AUTHORS.txt for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #ifndef _DIALOG_ENV_VAR_CONFIG_H_ 26 | #define _DIALOG_ENV_VAR_CONFIG_H_ 27 | 28 | class EDA_DRAW_FRAME; 29 | 30 | #include <../common/dialogs/dialog_env_var_config_base.h> 31 | 32 | #include 33 | 34 | 35 | /** 36 | * DIALOG_ENV_VAR_CONFIG class declaration 37 | */ 38 | 39 | class DIALOG_ENV_VAR_CONFIG: public DIALOG_ENV_VAR_CONFIG_BASE 40 | { 41 | private: 42 | ENV_VAR_MAP m_envVarMap; 43 | bool m_extDefsChanged; 44 | 45 | protected: 46 | virtual void OnAddRow( wxCommandEvent& aEvent ); 47 | virtual void OnDeleteSelectedRows( wxCommandEvent& aEvent ); 48 | virtual void OnHelpRequest( wxCommandEvent& aEvent ); 49 | 50 | public: 51 | DIALOG_ENV_VAR_CONFIG( wxWindow* parent, const ENV_VAR_MAP& aEnvVarMap ); 52 | 53 | bool TransferDataToWindow(); 54 | bool TransferDataFromWindow(); 55 | 56 | bool ExternalDefsChanged() const { return m_extDefsChanged; } 57 | 58 | const ENV_VAR_MAP& GetEnvVarMap() const 59 | { 60 | return m_envVarMap; 61 | } 62 | }; 63 | 64 | #endif // _DIALOG_ENV_VAR_CONFIG_H_ 65 | -------------------------------------------------------------------------------- /include/eda_dde.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /** 26 | * @file eda_dde.h 27 | * @brief DDE server & client. 28 | */ 29 | 30 | #ifndef EDA_DDE_H_ 31 | #define EDA_DDE_H_ 32 | 33 | #include 34 | 35 | 36 | // TCP/IP ports used by Pcbnew and Eeschema respectively. 37 | 38 | ///< Pcbnew listens on this port for commands from Eeschema 39 | #define KICAD_PCB_PORT_SERVICE_NUMBER 4242 40 | 41 | ///< Eeschema listens on this port for commands from Pcbnew 42 | #define KICAD_SCH_PORT_SERVICE_NUMBER 4243 43 | 44 | 45 | #define MSG_TO_PCB KICAD_PCB_PORT_SERVICE_NUMBER 46 | #define MSG_TO_SCH KICAD_SCH_PORT_SERVICE_NUMBER 47 | 48 | wxSocketServer* CreateServer( wxWindow * window, int port, bool local = true ); 49 | bool SendCommand( int port, const char* cmdline ); 50 | 51 | #endif // EDA_DDE_H_ 52 | -------------------------------------------------------------------------------- /include/eda_doc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2009-2014 Jerry Jacobs 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | /** 26 | * This file is part of the common library. 27 | * @file eda_doc.h 28 | * @see common.h 29 | */ 30 | 31 | #ifndef __INCLUDE__EDA_DOC_H__ 32 | #define __INCLUDE__EDA_DOC_H__ 1 33 | 34 | 35 | /** 36 | * Function KeyWordOk 37 | * searches \a aKeyList for any words found in \a aDatabase. 38 | * 39 | * @return 0 if no keyword is found or 1 if keyword is found. 40 | */ 41 | int KeyWordOk( const wxString& aKeyList, const wxString& aDatabase ); 42 | 43 | /** 44 | * Function GetAssociatedDocument 45 | * open a document (file) with the suitable browser 46 | * @param aParent = main frame 47 | * @param aDocName = filename of file to open (Full filename or short filename) 48 | * if \a aDocName begins with http: or ftp: or www. the default internet browser is launched 49 | * @param aPaths = a wxPathList to explore. 50 | * if NULL or aDocName is a full filename, aPath is not used. 51 | */ 52 | bool GetAssociatedDocument( wxWindow* aParent, 53 | const wxString& aDocName, 54 | const wxPathList* aPaths = NULL ); 55 | 56 | 57 | #endif /* __INCLUDE__EDA_DOC_H__ */ 58 | -------------------------------------------------------------------------------- /include/fctsys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #ifndef FCTSYS_H_ 26 | #define FCTSYS_H_ 27 | 28 | #include 29 | 30 | /** 31 | * @note This appears to already be included in the OSX build of wxWidgets. 32 | * Will someone with OSX please remove this and see if it compiles? 33 | */ 34 | #ifdef __WXMAC__ 35 | #include 36 | #endif 37 | 38 | #ifdef DEBUG 39 | #define DBG(x) x 40 | #else 41 | #define DBG(x) // nothing 42 | #endif 43 | 44 | 45 | #include 46 | 47 | #endif // FCTSYS_H__ 48 | -------------------------------------------------------------------------------- /include/frame_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014 CERN 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * @author Maciej Suminski 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, you may find one here: 20 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 | * or you may search the http://www.gnu.org website for the version 2 license, 22 | * or you may write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 24 | */ 25 | 26 | #ifndef FRAME_T_H_ 27 | #define FRAME_T_H_ 28 | 29 | /** 30 | * Enum FRAME_T 31 | * is the set of EDA_BASE_FRAME derivatives, typically stored in 32 | * EDA_BASE_FRAME::m_Ident. 33 | */ 34 | enum FRAME_T 35 | { 36 | FRAME_SCH, 37 | FRAME_SCH_LIB_EDITOR, 38 | FRAME_SCH_VIEWER, 39 | FRAME_SCH_VIEWER_MODAL, 40 | 41 | FRAME_PCB, 42 | FRAME_PCB_MODULE_EDITOR, 43 | FRAME_PCB_MODULE_VIEWER, 44 | FRAME_PCB_MODULE_VIEWER_MODAL, 45 | FRAME_PCB_FOOTPRINT_WIZARD_MODAL, 46 | FRAME_PCB_DISPLAY3D, 47 | 48 | FRAME_CVPCB, 49 | FRAME_CVPCB_DISPLAY, 50 | 51 | FRAME_GERBER, 52 | 53 | FRAME_PL_EDITOR, 54 | 55 | FRAME_BM2CMP, 56 | 57 | FRAME_CALC, 58 | 59 | KIWAY_PLAYER_COUNT, // counts subset of FRAME_T's which are KIWAY_PLAYER derivatives 60 | 61 | // C++ project manager is not a KIWAY_PLAYER 62 | KICAD_MAIN_FRAME_T = KIWAY_PLAYER_COUNT, 63 | 64 | FRAME_T_COUNT 65 | }; 66 | 67 | //TEXT_EDITOR_FRAME_T, 68 | 69 | 70 | #endif // FRAME_T_H_ 71 | -------------------------------------------------------------------------------- /include/gal/definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KICAD, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2012 Torsten Hueter, torstenhtr gmx.de 5 | * Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors. 6 | * 7 | * Macro definitions 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, you may find one here: 21 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 | * or you may search the http://www.gnu.org website for the version 2 license, 23 | * or you may write to the Free Software Foundation, Inc., 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 25 | */ 26 | 27 | #ifndef DEFINITIONS_H_ 28 | #define DEFINITIONS_H_ 29 | 30 | /// Swap the variables if a condition is met. 31 | #define SWAP( varA, condition, varB ) if( varA condition varB ) { double tmp = varA; varA = varB; \ 32 | varB = tmp; } 33 | 34 | namespace KIGFX 35 | { 36 | /** 37 | * RENDER_TARGET: Possible rendering targets 38 | */ 39 | enum RENDER_TARGET 40 | { 41 | TARGET_CACHED = 0, ///< Main rendering target (cached) 42 | TARGET_NONCACHED, ///< Auxiliary rendering target (noncached) 43 | TARGET_OVERLAY, ///< Items that may change while the view stays the same (noncached) 44 | TARGETS_NUMBER ///< Number of available rendering targets 45 | }; 46 | } // namespace KIGFX 47 | 48 | #endif /* DEFINITIONS_H_ */ 49 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/_fixes.hpp 25 | /// @date 2011-02-21 / 2011-11-22 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #include 30 | 31 | //! Workaround for compatibility with other libraries 32 | #ifdef max 33 | #undef max 34 | #endif 35 | 36 | //! Workaround for compatibility with other libraries 37 | #ifdef min 38 | #undef min 39 | #endif 40 | 41 | //! Workaround for Android 42 | #ifdef isnan 43 | #undef isnan 44 | #endif 45 | 46 | //! Workaround for Android 47 | #ifdef isinf 48 | #undef isinf 49 | #endif 50 | 51 | //! Workaround for Chrone Native Client 52 | #ifdef log2 53 | #undef log2 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/dummy.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/dummy.cpp 25 | /// @date 2011-01-19 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /// 28 | /// GLM is a header only library. There is nothing to compile. 29 | /// dummy.cpp exist only a wordaround for CMake file. 30 | /////////////////////////////////////////////////////////////////////////////////// 31 | 32 | #define GLM_MESSAGES 33 | #include "../glm.hpp" 34 | 35 | //#error "GLM is a header only library" 36 | 37 | int main() 38 | { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/hint.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/hint.hpp 25 | /// @date 2008-08-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type 30 | #define glm_core_type 31 | 32 | namespace glm 33 | { 34 | // Use dont_care, nicest and fastest to optimize implementations. 35 | class dont_care {}; 36 | class nicest {}; 37 | class fastest {}; 38 | }//namespace glm 39 | 40 | #endif//glm_core_type 41 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/intrinsic_trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_detail_intrinsic_trigonometric 30 | #define glm_detail_intrinsic_trigonometric 31 | 32 | #include "setup.hpp" 33 | 34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 35 | # error "SSE2 instructions not supported or enabled" 36 | #else 37 | 38 | namespace glm{ 39 | namespace detail 40 | { 41 | 42 | }//namespace detail 43 | }//namespace glm 44 | 45 | #include "intrinsic_trigonometric.inl" 46 | 47 | #endif//GLM_ARCH 48 | #endif//glm_detail_intrinsic_trigonometric 49 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/intrinsic_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_vector_relational.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_detail_intrinsic_vector_relational 30 | #define glm_detail_intrinsic_vector_relational 31 | 32 | #include "setup.hpp" 33 | 34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 35 | # error "SSE2 instructions not supported or enabled" 36 | #else 37 | 38 | namespace glm{ 39 | namespace detail 40 | { 41 | 42 | }//namespace detail 43 | }//namespace glm 44 | 45 | #include "intrinsic_vector_relational.inl" 46 | 47 | #endif//GLM_ARCH 48 | #endif//glm_detail_intrinsic_vector_relational 49 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/type_half.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/include/gal/opengl/glm/core/type_half.inl -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/type_mat.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_mat.hpp 25 | /// @date 2010-01-26 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_mat 30 | #define glm_core_type_mat 31 | 32 | #include "type_gentype.hpp" 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | 38 | }//namespace detail 39 | }//namespace glm 40 | 41 | #endif//glm_core_type_mat 42 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_mat.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/type_size.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_size.hpp 25 | /// @date 2008-10-05 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_size 30 | #define glm_core_type_size 31 | 32 | #include 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | //typedef std::size_t size_t; 38 | typedef int sizeType; 39 | 40 | }//namespace detail 41 | }//namespace glm 42 | 43 | #endif//glm_core_type_size 44 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/type_vec.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.hpp 25 | /// @date 2010-01-26 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_vec 30 | #define glm_core_type_vec 31 | 32 | #include "type_gentype.hpp" 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | 38 | }//namespace detail 39 | }//namespace glm 40 | 41 | #endif//glm_core_type_vec 42 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/core/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtc_swizzle 24 | /// @file glm/gtc/swizzle.inl 25 | /// @date 2009-06-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | namespace glm 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/closest_point.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef glm_gtx_closest_point 11 | #define glm_gtx_closest_point 12 | 13 | namespace glm 14 | { 15 | template 16 | GLM_FUNC_QUALIFIER detail::tvec3 closestPointOnLine 17 | ( 18 | detail::tvec3 const & point, 19 | detail::tvec3 const & a, 20 | detail::tvec3 const & b 21 | ) 22 | { 23 | valType LineLength = distance(a, b); 24 | detail::tvec3 Vector = point - a; 25 | detail::tvec3 LineDirection = (b - a) / LineLength; 26 | 27 | // Project Vector to LineDirection to get the distance of point from a 28 | valType Distance = dot(Vector, LineDirection); 29 | 30 | if(Distance <= valType(0)) return a; 31 | if(Distance >= LineLength) return b; 32 | return a + LineDirection * Distance; 33 | } 34 | }//namespace glm 35 | 36 | #endif//glm_gtx_closest_point 37 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/color_space_YCoCg.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-10-28 5 | // Updated : 2008-10-28 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/color_space_YCoCg.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 rgb2YCoCg 14 | ( 15 | detail::tvec3 const & rgbColor 16 | ) 17 | { 18 | detail::tvec3 result; 19 | result.x/*Y */ = rgbColor.r / valType(4) + rgbColor.g / valType(2) + rgbColor.b / valType(4); 20 | result.y/*Co*/ = rgbColor.r / valType(2) + rgbColor.g * valType(0) - rgbColor.b / valType(2); 21 | result.z/*Cg*/ = - rgbColor.r / valType(4) + rgbColor.g / valType(2) - rgbColor.b / valType(4); 22 | return result; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER detail::tvec3 rgb2YCoCgR 27 | ( 28 | detail::tvec3 const & rgbColor 29 | ) 30 | { 31 | detail::tvec3 result; 32 | result.x/*Y */ = rgbColor.g / valType(2) + (rgbColor.r + rgbColor.b) / valType(4); 33 | result.y/*Co*/ = rgbColor.r - rgbColor.b; 34 | result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / valType(2); 35 | return result; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER detail::tvec3 YCoCg2rgb 40 | ( 41 | detail::tvec3 const & YCoCgColor 42 | ) 43 | { 44 | detail::tvec3 result; 45 | result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; 46 | result.g = YCoCgColor.x + YCoCgColor.z; 47 | result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; 48 | return result; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER detail::tvec3 YCoCgR2rgb 53 | ( 54 | detail::tvec3 const & YCoCgRColor 55 | ) 56 | { 57 | detail::tvec3 result; 58 | valType tmp = YCoCgRColor.x - (YCoCgRColor.z / valType(2)); 59 | result.g = YCoCgRColor.z + tmp; 60 | result.b = tmp - (YCoCgRColor.y / valType(2)); 61 | result.r = result.b + YCoCgRColor.y; 62 | return result; 63 | } 64 | }//namespace glm 65 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/compatibility.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-16 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/compatibility.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | // isfinite 13 | template 14 | GLM_FUNC_QUALIFIER bool isfinite( 15 | genType const & x) 16 | { 17 | # if(GLM_COMPILER & GLM_COMPILER_VC) 18 | return _finite(x); 19 | # elif(GLM_COMPILER & GLM_COMPILER_GCC) 20 | # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) 21 | return _isfinite(x) != 0; 22 | # else 23 | return std::isfinite(x) != 0; 24 | # endif 25 | # else 26 | return std::isfinite(x) != 0; 27 | # endif 28 | } 29 | 30 | template 31 | GLM_FUNC_QUALIFIER detail::tvec2 isfinite( 32 | detail::tvec2 const & x) 33 | { 34 | return detail::tvec2( 35 | isfinite(x.x), 36 | isfinite(x.y)); 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER detail::tvec3 isfinite( 41 | detail::tvec3 const & x) 42 | { 43 | return detail::tvec3( 44 | isfinite(x.x), 45 | isfinite(x.y), 46 | isfinite(x.z)); 47 | } 48 | 49 | template 50 | GLM_FUNC_QUALIFIER detail::tvec4 isfinite( 51 | detail::tvec4 const & x) 52 | { 53 | return detail::tvec4( 54 | isfinite(x.x), 55 | isfinite(x.y), 56 | isfinite(x.z), 57 | isfinite(x.w)); 58 | } 59 | 60 | }//namespace glm 61 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/component_wise.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-21 5 | // Updated : 2010-02-12 6 | // Licence : This source is under MIT License 7 | // File : gtx_component_wise.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type compAdd(genType const & v) 14 | { 15 | typename genType::value_type result = typename genType::value_type(0); 16 | for(typename genType::size_type i = 0; i < v.length(); ++i) 17 | result += v[i]; 18 | return result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER typename genType::value_type compMul(genType const & v) 23 | { 24 | typename genType::value_type result = typename genType::value_type(1); 25 | for(typename genType::size_type i = 0; i < v.length(); ++i) 26 | result *= v[i]; 27 | return result; 28 | } 29 | 30 | template 31 | GLM_FUNC_QUALIFIER typename genType::value_type compMin(genType const & v) 32 | { 33 | typename genType::value_type result = typename genType::value_type(v[0]); 34 | for(typename genType::size_type i = 1; i < v.length(); ++i) 35 | result = min(result, v[i]); 36 | return result; 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER typename genType::value_type compMax(genType const & v) 41 | { 42 | typename genType::value_type result = typename genType::value_type(v[0]); 43 | for(typename genType::size_type i = 1; i < v.length(); ++i) 44 | result = max(result, v[i]); 45 | return result; 46 | } 47 | }//namespace glm 48 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/constants.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #ifndef GLM_GTX_constants 25 | #define GLM_GTX_constants GLM_VERSION 26 | 27 | #include "../gtc/constants.hpp" 28 | 29 | #if(defined(GLM_MESSAGES)) 30 | # pragma message("GLM: GLM_GTX_constants extension is deprecated, include GLM_GTC_constants (glm/gtc/constants.hpp) instead") 31 | #endif 32 | 33 | #endif//GLM_GTX_constants 34 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/epsilon.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_epsilon extension is deprecated, include GLM_GTC_epsilon (glm/gtc/epsilon) instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/epsilon.hpp" 30 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-07 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/extend.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | genType extend 14 | ( 15 | genType const & Origin, 16 | genType const & Source, 17 | genType const & Distance 18 | ) 19 | { 20 | return Origin + (Source - Origin) * Distance; 21 | } 22 | 23 | template 24 | detail::tvec2 extend 25 | ( 26 | detail::tvec2 const & Origin, 27 | detail::tvec2 const & Source, 28 | valType const & Distance 29 | ) 30 | { 31 | return Origin + (Source - Origin) * Distance; 32 | } 33 | 34 | template 35 | detail::tvec3 extend 36 | ( 37 | detail::tvec3 const & Origin, 38 | detail::tvec3 const & Source, 39 | valType const & Distance 40 | ) 41 | { 42 | return Origin + (Source - Origin) * Distance; 43 | } 44 | 45 | template 46 | detail::tvec4 extend 47 | ( 48 | detail::tvec4 const & Origin, 49 | detail::tvec4 const & Source, 50 | valType const & Distance 51 | ) 52 | { 53 | return Origin + (Source - Origin) * Distance; 54 | } 55 | }//namespace glm 56 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2009-03-06 5 | // Updated : 2009-03-09 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/gradient_paint.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | valType radialGradient 14 | ( 15 | detail::tvec2 const & Center, 16 | valType const & Radius, 17 | detail::tvec2 const & Focal, 18 | detail::tvec2 const & Position 19 | ) 20 | { 21 | detail::tvec2 F = Focal - Center; 22 | detail::tvec2 D = Position - Focal; 23 | valType Radius2 = pow2(Radius); 24 | valType Fx2 = pow2(F.x); 25 | valType Fy2 = pow2(F.y); 26 | 27 | valType Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 28 | valType Denominator = Radius2 - (Fx2 + Fy2); 29 | return Numerator / Denominator; 30 | } 31 | 32 | template 33 | valType linearGradient 34 | ( 35 | detail::tvec2 const & Point0, 36 | detail::tvec2 const & Point1, 37 | detail::tvec2 const & Position 38 | ) 39 | { 40 | detail::tvec2 Dist = Point1 - Point0; 41 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-02-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/handed_coordinate_space.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER bool rightHanded 14 | ( 15 | detail::tvec3 const & tangent, 16 | detail::tvec3 const & binormal, 17 | detail::tvec3 const & normal 18 | ) 19 | { 20 | return dot(cross(normal, tangent), binormal) > T(0); 21 | } 22 | 23 | template 24 | GLM_FUNC_QUALIFIER bool leftHanded 25 | ( 26 | detail::tvec3 const & tangent, 27 | detail::tvec3 const & binormal, 28 | detail::tvec3 const & normal 29 | ) 30 | { 31 | return dot(cross(normal, tangent), binormal) < T(0); 32 | } 33 | }//namespace glm 34 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/int_10_10_10_2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-07-07 5 | // Updated : 2010-07-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/int_10_10_10_2.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast 13 | ( 14 | glm::vec4 const & v 15 | ) 16 | { 17 | return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30); 18 | } 19 | }//namespace glm 20 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/log_base.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtx_log_base 24 | /// @file glm/gtx/log_base.hpp 25 | /// @date 2008-10-24 / 2011-06-07 26 | /// @author Christophe Riccio 27 | /// 28 | /// @see core (dependence) 29 | /// 30 | /// @defgroup gtx_log_base GLM_GTX_log_base 31 | /// @ingroup gtx 32 | /// 33 | /// @brief Logarithm for any base. base can be a vector or a scalar. 34 | /// 35 | /// need to be included to use these functionalities. 36 | /////////////////////////////////////////////////////////////////////////////////// 37 | 38 | #ifndef GLM_GTX_log_base 39 | #define GLM_GTX_log_base GLM_VERSION 40 | 41 | // Dependency: 42 | #include "../glm.hpp" 43 | 44 | #if(defined(GLM_MESSAGES) && !defined(glm_ext)) 45 | # pragma message("GLM: GLM_GTX_log_base extension included") 46 | #endif 47 | 48 | namespace glm 49 | { 50 | /// @addtogroup gtx_log_base 51 | /// @{ 52 | 53 | //! Logarithm for any base. 54 | //! From GLM_GTX_log_base. 55 | template 56 | genType log( 57 | genType const & x, 58 | genType const & base); 59 | 60 | /// @} 61 | }//namespace glm 62 | 63 | #include "log_base.inl" 64 | 65 | #endif//GLM_GTX_log_base 66 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-10-24 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/log_base.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER genType log( 14 | genType const & x, 15 | genType const & base) 16 | { 17 | assert(x != genType(0)); 18 | 19 | return glm::log(x) / glm::log(base); 20 | } 21 | 22 | VECTORIZE_VEC_SCA(log) 23 | VECTORIZE_VEC_VEC(log) 24 | }//namespace glm 25 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/matrix_cross_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 matrixCross3 14 | ( 15 | detail::tvec3 const & x 16 | ) 17 | { 18 | detail::tmat3x3 Result(T(0)); 19 | Result[0][1] = x.z; 20 | Result[1][0] = -x.z; 21 | Result[0][2] = -x.y; 22 | Result[2][0] = x.y; 23 | Result[1][2] = x.x; 24 | Result[2][1] = -x.x; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER detail::tmat4x4 matrixCross4 30 | ( 31 | detail::tvec3 const & x 32 | ) 33 | { 34 | detail::tmat4x4 Result(T(0)); 35 | Result[0][1] = x.z; 36 | Result[1][0] = -x.z; 37 | Result[0][2] = -x.y; 38 | Result[2][0] = x.y; 39 | Result[1][2] = x.x; 40 | Result[2][1] = -x.x; 41 | return Result; 42 | } 43 | 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-04-03 5 | // Updated : 2008-09-17 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/mixed_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER valType mixedProduct 14 | ( 15 | detail::tvec3 const & v1, 16 | detail::tvec3 const & v2, 17 | detail::tvec3 const & v3 18 | ) 19 | { 20 | return dot(cross(v1, v2), v3); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/noise.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random (glm/gtc/noise.hpp) instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/noise.hpp" 30 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2011-06-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/normal.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 triangleNormal 14 | ( 15 | detail::tvec3 const & p1, 16 | detail::tvec3 const & p2, 17 | detail::tvec3 const & p3 18 | ) 19 | { 20 | return normalize(cross(p1 - p2, p1 - p3)); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-10 5 | // Updated : 2007-05-10 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/number_precision.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/ocl_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtx_ocl_type 24 | /// @file glm/gtx/ocl_type.inl 25 | /// @date 2013-03-16 / 2013-03-16 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-27 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/optimum_pow.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER genType pow2(const genType& x) 14 | { 15 | return x * x; 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER genType pow3(const genType& x) 20 | { 21 | return x * x * x; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER genType pow4(const genType& x) 26 | { 27 | return x * x * x * x; 28 | } 29 | 30 | GLM_FUNC_QUALIFIER bool powOfTwo(int x) 31 | { 32 | return !(x & (x - 1)); 33 | } 34 | 35 | GLM_FUNC_QUALIFIER detail::tvec2 powOfTwo(const detail::tvec2& x) 36 | { 37 | return detail::tvec2( 38 | powOfTwo(x.x), 39 | powOfTwo(x.y)); 40 | } 41 | 42 | GLM_FUNC_QUALIFIER detail::tvec3 powOfTwo(const detail::tvec3& x) 43 | { 44 | return detail::tvec3( 45 | powOfTwo(x.x), 46 | powOfTwo(x.y), 47 | powOfTwo(x.z)); 48 | } 49 | 50 | GLM_FUNC_QUALIFIER detail::tvec4 powOfTwo(const detail::tvec4& x) 51 | { 52 | return detail::tvec4( 53 | powOfTwo(x.x), 54 | powOfTwo(x.y), 55 | powOfTwo(x.z), 56 | powOfTwo(x.w)); 57 | } 58 | }//namespace glm 59 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/orthonormalize.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 orthonormalize 14 | ( 15 | const detail::tmat3x3& m 16 | ) 17 | { 18 | detail::tmat3x3 r = m; 19 | 20 | r[0] = normalize(r[0]); 21 | 22 | float d0 = dot(r[0], r[1]); 23 | r[1] -= r[0] * d0; 24 | r[1] = normalize(r[1]); 25 | 26 | float d1 = dot(r[1], r[2]); 27 | d0 = dot(r[0], r[2]); 28 | r[2] -= r[0] * d0 + r[1] * d1; 29 | r[2] = normalize(r[2]); 30 | 31 | return r; 32 | } 33 | 34 | template 35 | GLM_FUNC_QUALIFIER detail::tvec3 orthonormalize 36 | ( 37 | const detail::tvec3& x, 38 | const detail::tvec3& y 39 | ) 40 | { 41 | return normalize(x - y * dot(y, x)); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/perpendicular.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType perp 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return x - proj(x, Normal); 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-06 5 | // Updated : 2009-05-01 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/polar_coordinates.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 polar 14 | ( 15 | detail::tvec3 const & euclidean 16 | ) 17 | { 18 | T const Length(length(euclidean)); 19 | detail::tvec3 const tmp(euclidean / Length); 20 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 21 | 22 | #ifdef GLM_FORCE_RADIANS 23 | return detail::tvec3( 24 | atan(xz_dist, tmp.y), // latitude 25 | atan(tmp.x, tmp.z), // longitude 26 | xz_dist); // xz distance 27 | #else 28 | return detail::tvec3( 29 | degrees(atan(xz_dist, tmp.y)), // latitude 30 | degrees(atan(tmp.x, tmp.z)), // longitude 31 | xz_dist); // xz distance 32 | #endif 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER detail::tvec3 euclidean 37 | ( 38 | detail::tvec2 const & polar 39 | ) 40 | { 41 | #ifdef GLM_FORCE_RADIANS 42 | T const latitude(polar.x); 43 | T const longitude(polar.y); 44 | #else 45 | T const latitude(radians(polar.x)); 46 | T const longitude(radians(polar.y)); 47 | #endif 48 | 49 | return detail::tvec3( 50 | cos(latitude) * sin(longitude), 51 | sin(latitude), 52 | cos(latitude) * cos(longitude)); 53 | } 54 | 55 | }//namespace glm 56 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtx_projection 24 | /// @file glm/gtx/projection.hpp 25 | /// @date 2005-12-21 / 2011-06-07 26 | /// @author Christophe Riccio 27 | /// 28 | /// @see core (dependence) 29 | /// 30 | /// @defgroup gtx_projection GLM_GTX_projection 31 | /// @ingroup gtx 32 | /// 33 | /// @brief Projection of a vector to other one 34 | /// 35 | /// need to be included to use these functionalities. 36 | /////////////////////////////////////////////////////////////////////////////////// 37 | 38 | #ifndef GLM_GTX_projection 39 | #define GLM_GTX_projection GLM_VERSION 40 | 41 | // Dependency: 42 | #include "../glm.hpp" 43 | 44 | #if(defined(GLM_MESSAGES) && !defined(glm_ext)) 45 | # pragma message("GLM: GLM_GTX_projection extension included") 46 | #endif 47 | 48 | namespace glm 49 | { 50 | /// @addtogroup gtx_projection 51 | /// @{ 52 | 53 | //! Projects x on Normal. 54 | //! From GLM_GTX_projection extension. 55 | template 56 | vecType proj( 57 | vecType const & x, 58 | vecType const & Normal); 59 | 60 | /// @} 61 | }//namespace glm 62 | 63 | #include "projection.inl" 64 | 65 | #endif//GLM_GTX_projection 66 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/projection.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType proj 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/random.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/random.hpp" 30 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-11-19 5 | // Updated : 2008-11-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/raw_data.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Dependency: 10 | // - GLM core 11 | /////////////////////////////////////////////////////////////////////////////////////////////////// 12 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/reciprocal.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_reciprocal extension is deprecated, include GLM_GTC_reciprocal instead") 26 | #endif 27 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-06-08 5 | // Updated : 2008-06-08 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/std_based_type.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/ulp.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_ulp extension is deprecated, include GLM_GTC_ulp (glm/gtc/ulp.hpp) instead") 26 | #endif 27 | 28 | // Promoted: 29 | #include "../gtc/ulp.hpp" 30 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/unsigned_int.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_unsigned_int extension is deprecated, include GLM_GTX_integer instead") 26 | #endif 27 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/unsigned_int.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-24 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/unsigned_int.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/vec1.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtx_vec1 24 | /// @file glm/gtx/vec1.inl 25 | /// @date 2013-03-16 / 2013-03-16 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/vector_access.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-16 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_access.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER void set 14 | ( 15 | detail::tvec2& v, 16 | valType const & x, 17 | valType const & y 18 | ) 19 | { 20 | v.x = x; 21 | v.y = y; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER void set 26 | ( 27 | detail::tvec3& v, 28 | valType const & x, 29 | valType const & y, 30 | valType const & z 31 | ) 32 | { 33 | v.x = x; 34 | v.y = y; 35 | v.z = z; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER void set 40 | ( 41 | detail::tvec4& v, 42 | valType const & x, 43 | valType const & y, 44 | valType const & z, 45 | valType const & w 46 | ) 47 | { 48 | v.x = x; 49 | v.y = y; 50 | v.z = z; 51 | v.w = w; 52 | } 53 | }//namespace glm 54 | -------------------------------------------------------------------------------- /include/gal/opengl/glm/gtx/vector_angle.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-09-29 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_angle.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type angle 14 | ( 15 | genType const & x, 16 | genType const & y 17 | ) 18 | { 19 | return degrees(acos(dot(x, y))); 20 | } 21 | 22 | //! \todo epsilon is hard coded to 0.01 23 | template 24 | GLM_FUNC_QUALIFIER valType orientedAngle 25 | ( 26 | detail::tvec2 const & x, 27 | detail::tvec2 const & y 28 | ) 29 | { 30 | #ifdef GLM_FORCE_RADIANS 31 | valType const Angle(acos(dot(x, y))); 32 | #else 33 | valType const Angle(glm::degrees(acos(dot(x, y)))); 34 | #endif 35 | detail::tvec2 const TransformedVector(glm::rotate(x, Angle)); 36 | if(all(epsilonEqual(y, TransformedVector, valType(0.01)))) 37 | return Angle; 38 | else 39 | return -Angle; 40 | } 41 | 42 | template 43 | GLM_FUNC_QUALIFIER valType orientedAngle 44 | ( 45 | detail::tvec3 const & x, 46 | detail::tvec3 const & y, 47 | detail::tvec3 const & ref 48 | ) 49 | { 50 | valType const Angle(glm::degrees(glm::acos(glm::dot(x, y)))); 51 | 52 | if(glm::dot(ref, glm::cross(x, y)) < valType(0)) 53 | return -Angle; 54 | else 55 | return Angle; 56 | } 57 | }//namespace glm 58 | -------------------------------------------------------------------------------- /include/geometry/shape_file_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2015 CERN 5 | * @author Tomasz Wlostowski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | 26 | #ifndef __SHAPE_FILE_IO_H 27 | #define __SHAPE_FILE_IO_H 28 | 29 | #include 30 | 31 | class SHAPE; 32 | 33 | /** 34 | * Class SHAPE_FILE_IO 35 | * 36 | * Helper class for saving/loading shapes from a file. 37 | */ 38 | class SHAPE_FILE_IO 39 | { 40 | public: 41 | enum IO_MODE 42 | { 43 | IOM_READ = 0, 44 | IOM_APPEND, 45 | IOM_WRITE 46 | }; 47 | 48 | SHAPE_FILE_IO( const std::string& aFilename, IO_MODE aMode = IOM_READ ); 49 | ~SHAPE_FILE_IO(); 50 | 51 | void BeginGroup( const std::string aName = ""); 52 | void EndGroup(); 53 | 54 | SHAPE* Read(); 55 | 56 | void Write( const SHAPE* aShape, const std::string aName = "" ); 57 | 58 | void Write( const SHAPE& aShape, const std::string aName = "" ) 59 | { 60 | Write( &aShape, aName ); 61 | } 62 | 63 | private: 64 | FILE* m_file; 65 | bool m_groupActive; 66 | IO_MODE m_mode; 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/i18n_utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, you may find one here: 18 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 | * or you may search the http://www.gnu.org website for the version 2 license, 20 | * or you may write to the Free Software Foundation, Inc., 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 22 | */ 23 | 24 | /** 25 | * @file i18n_utility.h 26 | * @brief Some functions to handle hotkeys in KiCad 27 | */ 28 | 29 | #ifndef I18N_UTILITY_H 30 | #define I18N_UTILITY_H 31 | 32 | // A define to allow translation of strings which must be stored in English (for instance 33 | // because they are used both as keywords and as messages in dialogs 34 | // We do not want to use the _( x ) usual macro from wxWidgets, which calls wxGetTranslation(), 35 | // because the English string is used in key file configuration 36 | // The translated string is used only when displaying the help window. 37 | // Therefore translation tools have to use the "_" and the "_HKI" prefix to extract 38 | // strings to translate 39 | #define _HKI( x ) wxT( x ) 40 | 41 | #endif // I18N_UTILITY_H 42 | -------------------------------------------------------------------------------- /include/import_export.h: -------------------------------------------------------------------------------- 1 | #ifndef IMPORT_EXPORT_H_ 2 | #define IMPORT_EXPORT_H_ 3 | /* 4 | * This program source code file is part of KiCad, a free EDA CAD application. 5 | * 6 | * Copyright (C) 2011 SoftPLC Corporation, Dick Hollenbeck 7 | * Copyright (C) 2011 KiCad Developers, see change_log.txt for contributors. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, you may find one here: 21 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 | * or you may search the http://www.gnu.org website for the version 2 license, 23 | * or you may write to the Free Software Foundation, Inc., 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 25 | */ 26 | 27 | 28 | /// Macros which export functions from a DLL/DSO. 29 | /// See: http://gcc.gnu.org/wiki/Visibility 30 | 31 | #if defined(__MINGW32__) 32 | #define APIEXPORT __declspec(dllexport) 33 | #define APIIMPORT __declspec(dllimport) 34 | #define APILOCAL 35 | 36 | #elif defined(__GNUC__) && __GNUC__ >= 4 37 | // On ELF, we compile with hidden visibility, so unwrap that for specific symbols: 38 | #define APIEXPORT __attribute__ ((visibility("default"))) 39 | #define APIIMPORT __attribute__ ((visibility("default"))) 40 | #define APILOCAL __attribute__ ((visibility("hidden"))) 41 | 42 | #else 43 | #pragma message ( "warning: a supported C++ compiler is required" ) 44 | #define APIEXPORT 45 | #define APIIMPORT 46 | #define APILOCAL 47 | #endif 48 | 49 | 50 | #if defined(COMPILING_DLL) 51 | // Be sure and define COMPILING_DLL when compiling implementation, and NOT when 52 | // compiling the client. 53 | #define MY_API(rettype) APIEXPORT rettype 54 | #else 55 | #define MY_API(rettype) APIIMPORT rettype 56 | #endif 57 | 58 | #define MY_LOCAL(rettype) APILOCAL rettype 59 | 60 | #endif // IMPORT_EXPORT_H_ 61 | -------------------------------------------------------------------------------- /include/ki_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2013-2014 SoftPLC Corporation, Dick Hollenbeck 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #ifndef KI_MUTEX_H_ 26 | #define KI_MUTEX_H_ 27 | 28 | 29 | /// Establish KiCad MUTEX choices here in this file: 30 | /// typedef MUTEX and typedef MUTLOCK. 31 | /// 32 | /// Using an unnamed resource is easier, providing a textual name for a 33 | /// constructor is cumbersome, so we make choice on that criteria mostly: 34 | 35 | #if 1 36 | 37 | // This is a fine choice between the two, but requires linking to ${Boost_LIBRARIES} 38 | 39 | #include 40 | #include 41 | 42 | typedef boost::interprocess::interprocess_mutex MUTEX; 43 | typedef boost::interprocess::scoped_lock MUTLOCK; 44 | 45 | #else 46 | 47 | // This choice also works. 48 | 49 | #include 50 | 51 | typedef wxMutex MUTEX; 52 | typedef wxMutexLocker MUTLOCK; 53 | 54 | #endif 55 | 56 | #endif // KI_MUTEX_H_ 57 | -------------------------------------------------------------------------------- /include/kiway_mgr.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef KIWAY_MGR_H_ 3 | #define KIWAY_MGR_H_ 4 | 5 | /* 6 | * This program source code file is part of KiCad, a free EDA CAD application. 7 | * 8 | * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck 9 | * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU General Public License 13 | * as published by the Free Software Foundation; either version 2 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, you may find one here: 23 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 24 | * or you may search the http://www.gnu.org website for the version 2 license, 25 | * or you may write to the Free Software Foundation, Inc., 26 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 27 | */ 28 | 29 | 30 | #include 31 | #include 32 | 33 | 34 | /** 35 | * Class KIWAY_MGR 36 | * is a container for all KIWAYS [and PROJECTS]. This class needs to work both 37 | * for a C++ project manager and an a wxPython one (after being moved into a 38 | * header later). 39 | */ 40 | class KIWAY_MGR 41 | { 42 | public: 43 | //KIWAY_MGR(); 44 | // ~KIWAY_MGR(); 45 | 46 | bool OnStart( wxApp* aProcess ); 47 | 48 | void OnEnd(); 49 | 50 | KIWAY& operator[]( int aIndex ) 51 | { 52 | wxASSERT( m_kiways.size() ); // stuffed in OnStart() 53 | return m_kiways[aIndex]; 54 | } 55 | 56 | private: 57 | 58 | // KIWAYs may not be moved once doled out, since window DNA depends on the 59 | // pointer being good forever. 60 | // boost_ptr::vector however never moves the object pointed to. 61 | typedef boost::ptr_vector KIWAYS; 62 | 63 | KIWAYS m_kiways; 64 | }; 65 | 66 | extern KIWAY_MGR Kiways; 67 | 68 | #endif // KIWAY_MGR_H_ 69 | -------------------------------------------------------------------------------- /include/mail_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014 CERN 5 | * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors. 6 | * @author Maciej Suminski 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, you may find one here: 20 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 | * or you may search the http://www.gnu.org website for the version 2 license, 22 | * or you may write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 24 | */ 25 | 26 | 27 | #ifndef MAIL_TYPE_H_ 28 | #define MAIL_TYPE_H_ 29 | 30 | /** 31 | * Enum MAIL_T 32 | * is the set of mail types sendable via KIWAY::ExpressMail() and supplied as 33 | * the @a aCommand parameter to that function. Such mail will be received in 34 | * KIWAY_PLAYER::KiwayMailIn( KIWAY_EXPRESS& aEvent ) and aEvent.Command() will 35 | * match aCommand to KIWAY::ExpressMail(). 36 | */ 37 | enum MAIL_T 38 | { 39 | MAIL_CROSS_PROBE, ///< PCB<->SCH, CVPCB->SCH cross-probing. 40 | MAIL_BACKANNOTATE_FOOTPRINTS, ///< CVPCB->SCH footprint stuffing at cvpcb termination 41 | MAIL_EESCHEMA_NETLIST, ///< EESCHEMA->CVPCB netlist immediately after launching CVPCB 42 | }; 43 | 44 | #endif // MAIL_TYPE_H_ 45 | -------------------------------------------------------------------------------- /include/math/math_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KICAD, a free EDA CAD application. 3 | * 4 | * Copyright (c) 2005 Michael Niedermayer 5 | * Copyright (C) CERN 6 | * @author Tomasz Wlostowski 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, you may find one here: 20 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 | * or you may search the http://www.gnu.org website for the version 2 license, 22 | * or you may write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 24 | */ 25 | 26 | #ifndef __MATH_UTIL_H 27 | #define __MATH_UTIL_H 28 | 29 | #include 30 | 31 | /** 32 | * Function rescale() 33 | * 34 | * Scales a number (value) by rational (numerator/denominator). Numerator must be <= denominator. 35 | */ 36 | 37 | template 38 | T rescale( T aNumerator, T aValue, T aDenominator ) 39 | { 40 | return aNumerator * aValue / aDenominator; 41 | } 42 | 43 | template 44 | int sign( T val ) 45 | { 46 | return ( T( 0 ) < val) - ( val < T( 0 ) ); 47 | } 48 | 49 | // explicit specializations for integer types, taking care of overflow. 50 | template <> 51 | int rescale( int aNumerator, int aValue, int aDenominator ); 52 | 53 | template <> 54 | int64_t rescale( int64_t aNumerator, int64_t aValue, int64_t aDenominator ); 55 | 56 | #endif // __MATH_UTIL_H 57 | -------------------------------------------------------------------------------- /include/newstroke_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | * newstroke_font.h - header for automatically converted font 3 | * 4 | * This program source code file is part of KiCad, a free EDA CAD application. 5 | * 6 | * Copyright (C) 2010 vladimir uryvaev 7 | * Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors. 8 | * 9 | * This program is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License 11 | * as published by the Free Software Foundation; either version 2 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, you may find one here: 21 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 | * or you may search the http://www.gnu.org website for the version 2 license, 23 | * or you may write to the Free Software Foundation, Inc., 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 25 | */ 26 | #ifndef __NEWSTROKE_FONT_H__ 27 | #define __NEWSTROKE_FONT_H__ 28 | 29 | /** 30 | * Array containing strokes for unicode glyphs 31 | */ 32 | extern const char* const newstroke_font[]; //The font 33 | extern const int newstroke_font_bufsize; //font buffer size 34 | 35 | #endif /* __NEWSTROKE_FONT_H__ */ 36 | -------------------------------------------------------------------------------- /include/online_help.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file online_help.h 3 | * @brief Definitions for online help for KiCad. 4 | */ 5 | 6 | #ifndef ONLINE_HELP_H 7 | #define ONLINE_HELP_H 8 | 9 | /* 10 | * KiCad uses HTML or PDF file format in the online help (help command) 11 | */ 12 | 13 | #endif /* #ifndef ONLINE_HELP_H */ 14 | -------------------------------------------------------------------------------- /include/pad_shapes.h: -------------------------------------------------------------------------------- 1 | /******************/ 2 | /* pad_shapes.h */ 3 | /******************/ 4 | 5 | #ifndef PAD_SHAPES_H_ 6 | #define PAD_SHAPES_H_ 7 | 8 | /** 9 | * Enum PAD_SHAPE_T 10 | * is the set of pad shapes, used with D_PAD::{Set,Get}Shape() 11 | */ 12 | enum PAD_SHAPE_T 13 | { 14 | PAD_SHAPE_CIRCLE, 15 | PAD_CIRCLE = PAD_SHAPE_CIRCLE, 16 | PAD_SHAPE_RECT, 17 | PAD_RECT = PAD_SHAPE_RECT, 18 | PAD_SHAPE_OVAL, 19 | PAD_OVAL = PAD_SHAPE_OVAL, 20 | PAD_SHAPE_TRAPEZOID, 21 | PAD_TRAPEZOID = PAD_SHAPE_TRAPEZOID 22 | }; 23 | 24 | /** 25 | * Enum PAD_DRILL_SHAPE_T 26 | * is the set of pad drill shapes, used with D_PAD::{Set,Get}DrillShape() 27 | * The double name is for convenience of Python devs 28 | */ 29 | enum PAD_DRILL_SHAPE_T 30 | { 31 | PAD_DRILL_SHAPE_CIRCLE, 32 | PAD_DRILL_SHAPE_OBLONG, 33 | }; 34 | 35 | 36 | /** 37 | * Enum PAD_ATTR_T 38 | * is the set of pad shapes, used with D_PAD::{Set,Get}Attribute() 39 | * The double name is for convenience of Python devs 40 | */ 41 | enum PAD_ATTR_T 42 | { 43 | PAD_ATTRIB_STANDARD, ///< Usual pad 44 | PAD_STANDARD = PAD_ATTRIB_STANDARD, 45 | PAD_ATTRIB_SMD, ///< Smd pad, appears on the solder paste layer (default) 46 | PAD_SMD = PAD_ATTRIB_SMD, 47 | PAD_ATTRIB_CONN, ///< Like smd, does not appear on the solder paste layer (default) 48 | PAD_CONN = PAD_ATTRIB_CONN, 49 | PAD_ATTRIB_HOLE_NOT_PLATED, ///< like PAD_STANDARD, but not plated 50 | ///< mechanical use only, no connection allowed 51 | PAD_HOLE_NOT_PLATED = PAD_ATTRIB_HOLE_NOT_PLATED 52 | }; 53 | 54 | 55 | #endif // PAD_SHAPES_H_ 56 | -------------------------------------------------------------------------------- /include/pcbcommon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, you may find one here: 18 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 | * or you may search the http://www.gnu.org website for the version 2 license, 20 | * or you may write to the Free Software Foundation, Inc., 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 22 | */ 23 | 24 | /** 25 | * @file pcbcommon.h 26 | */ 27 | 28 | #ifndef PCBCOMMON_H_ 29 | #define PCBCOMMON_H_ 30 | 31 | class PGM_BASE; 32 | 33 | 34 | /// Utility for comma separated lists 35 | inline void AccumulateDescription( wxString &aDesc, const wxString &aItem ) 36 | { 37 | if( !aDesc.IsEmpty() ) 38 | aDesc << wxT(", "); 39 | aDesc << aItem; 40 | } 41 | 42 | #endif // PCBCOMMON_H_ 43 | -------------------------------------------------------------------------------- /include/tool/examples/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS = -I../.. -I../../boost 2 | 3 | all: delegate_example coroutine_example 4 | 5 | delegate_example: delegate_example.cpp 6 | g++ -o $@ $^ $(CXXFLAGS) 7 | 8 | coroutine_example: coroutine_example.cpp 9 | g++ -o $@ $^ $(CXXFLAGS) -lboost_context -------------------------------------------------------------------------------- /include/tool/examples/coroutine_example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | typedef COROUTINE MyCoroutine; 7 | 8 | class MyClass 9 | { 10 | public: 11 | int CountTo( int n ) 12 | { 13 | printf( "%s: Coroutine says hi. I will count from 1 to %d and yield each value.\n", 14 | __FUNCTION__, 15 | n ); 16 | 17 | for( int i = 1; i <= n; i++ ) 18 | { 19 | printf( "%s: Yielding %d\n", __FUNCTION__, i ); 20 | cofunc.Yield( i ); 21 | } 22 | } 23 | 24 | void Run() 25 | { 26 | cofunc = MyCoroutine( this, &MyClass::CountTo ); 27 | printf( "%s: Calling coroutine that will count from 1 to 5.\n", __FUNCTION__ ); 28 | cofunc.Call( 5 ); 29 | 30 | while( cofunc.Running() ) 31 | { 32 | printf( "%s: Got value: %d\n", __FUNCTION__, cofunc.ReturnValue() ); 33 | cofunc.Resume(); 34 | } 35 | 36 | printf( "%s: Done!\n", __FUNCTION__ ); 37 | } 38 | 39 | MyCoroutine cofunc; 40 | }; 41 | 42 | 43 | main() { 44 | MyClass obj; 45 | 46 | obj.Run(); 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /include/tool/examples/delegate_example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | class MyClass 7 | { 8 | public: 9 | int MyMethod( const string& arg ) 10 | { 11 | printf( "MyClass(this = %p)::MyMethod() called with string '%s', length %d\n", this, 12 | arg.c_str(), arg.length() ); 13 | return arg.length(); 14 | } 15 | }; 16 | 17 | typedef DELEGATE MyDelegate; 18 | 19 | main() 20 | { 21 | MyClass t1; 22 | MyClass t2; 23 | 24 | MyDelegate ptr1( &t1, &MyClass::MyMethod ); 25 | MyDelegate ptr2( &t2, &MyClass::MyMethod ); 26 | 27 | int retval1, retval2; 28 | 29 | retval1 = ptr1( "apples" ); 30 | retval2 = ptr2( "cherries" ); 31 | 32 | printf( "Object 1 returned %d, object 2 returned %d\n", retval1, retval2 ); 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /include/worksheet.h: -------------------------------------------------------------------------------- 1 | /***************/ 2 | /* worksheet.h */ 3 | /***************/ 4 | 5 | // For page and paper size, values are in 1/1000 inch 6 | 7 | #ifndef WORKSHEET_H_ 8 | #define WORKSHEET_H_ 9 | 10 | #include // EDA_COLOR_T definition 11 | #include 12 | 13 | // Forward declarations: 14 | class EDA_DRAW_PANEL; 15 | class EDA_RECT; 16 | class TITLE_BLOCK; 17 | 18 | /** 19 | * Function DrawPageLayout is a core function to draw the page layout with 20 | * the frame and the basic inscriptions. 21 | * @param aDC The device context. 22 | * @param aClipBox = the clipping rect, or NULL if no clipping. 23 | * @param aPageInfo for margins and page size (in mils). 24 | * @param aFullSheetName The sheetpath (full sheet name), for basic inscriptions. 25 | * @param aFileName The file name, for basic inscriptions. 26 | * @param aTitleBlock The sheet title block, for basic inscriptions. 27 | * @param aSheetCount The number of sheets (for basic inscriptions). 28 | * @param aSheetNumber The sheet number (for basic inscriptions). 29 | * @param aPenWidth the pen size The line width for drawing. 30 | * @param aScalar the scale factor to convert from mils to internal units. 31 | * @param aColor The color for drawing. 32 | * @param aAltColor The color for items which need to be "hightlighted". 33 | * 34 | * Parameters used in aPageInfo 35 | * - the size of the page layout. 36 | * - the LTmargin The left top margin of the page layout. 37 | * - the RBmargin The right bottom margin of the page layout. 38 | */ 39 | void DrawPageLayout( wxDC* aDC, EDA_RECT* aClipBox, 40 | const PAGE_INFO& aPageInfo, 41 | const wxString &aFullSheetName, 42 | const wxString& aFileName, 43 | TITLE_BLOCK& aTitleBlock, 44 | int aSheetCount, int aSheetNumber, 45 | int aPenWidth, double aScalar, 46 | EDA_COLOR_T aColor, EDA_COLOR_T aAltColor ); 47 | 48 | 49 | #endif // WORKSHEET_H_ 50 | -------------------------------------------------------------------------------- /include/wx_status_popup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KiCad, a free EDA CAD application. 3 | * 4 | * Copyright (C) 2014-2015 CERN 5 | * Author: Tomasz Wlostowski 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, you may find one here: 19 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 | * or you may search the http://www.gnu.org website for the version 2 license, 21 | * or you may write to the Free Software Foundation, Inc., 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 23 | */ 24 | 25 | #ifndef __WX_STATUS_POPUP_H_ 26 | #define __WX_STATUS_POPUP_H_ 27 | 28 | 29 | #include 30 | #include 31 | 32 | class PCB_EDIT_FRAME; 33 | 34 | /** 35 | * Class WX_STATUS_POPUP 36 | * 37 | * A tiny, headerless popup window used to display useful status (e.g. line length 38 | * tuning info) next to the mouse cursor. 39 | */ 40 | 41 | class WX_STATUS_POPUP: public wxPopupWindow 42 | { 43 | public: 44 | WX_STATUS_POPUP( PCB_EDIT_FRAME* aParent ); 45 | virtual ~WX_STATUS_POPUP(); 46 | 47 | virtual void Popup(wxWindow* aFocus = NULL); 48 | virtual void Move( const wxPoint &aWhere ); 49 | 50 | protected: 51 | 52 | void updateSize(); 53 | 54 | wxPanel* m_panel; 55 | wxBoxSizer* m_topSizer; 56 | }; 57 | 58 | #endif /* __WX_STATUS_POPUP_H_*/ 59 | -------------------------------------------------------------------------------- /inkscape/svg2shenzhen_about.inx: -------------------------------------------------------------------------------- 1 | 2 | 3 | <_name>About 4 | net.svg2shenzhen.about.me 5 | 6 | 7 | 8 | 9 | <_param name="help" type="description" xml:space="preserve">Inkscape Extension to Export Drawings as a KiCad Module or KiCad Project 10 | 11 | To get updates, get help, review the source, or contribute please visit the project's GitHub page. 12 | 13 | Thank you to everyone who has contributed to Svg2Shenzhen. 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | all 27 | 28 | 29 | -------------------------------------------------------------------------------- /polygon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories(BEFORE ${INC_BEFORE}) 3 | include_directories( 4 | ${INC_AFTER} 5 | ) 6 | 7 | set(POLYGON_SRCS 8 | math_for_graphics.cpp 9 | PolyLine.cpp 10 | polygon_test_point_inside.cpp 11 | clipper.cpp 12 | ) 13 | 14 | add_library(polygon STATIC ${POLYGON_SRCS}) 15 | 16 | add_dependencies( polygon lib-dependencies ) 17 | 18 | -------------------------------------------------------------------------------- /polygon/clipper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/polygon/clipper.cpp -------------------------------------------------------------------------------- /polygon/determine_if_point_inside_polygon.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/polygon/determine_if_point_inside_polygon.odt -------------------------------------------------------------------------------- /polygon/poly2tri/poly2tri.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors 3 | * http://code.google.com/p/poly2tri/ 4 | * 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * * Neither the name of Poly2Tri nor the names of its contributors may be 16 | * used to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef POLY2TRI_H 33 | #define POLY2TRI_H 34 | 35 | #include "common/shapes.h" 36 | #include "sweep/cdt.h" 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /polygon/poly2tri/sweep/cdt.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors 3 | * http://code.google.com/p/poly2tri/ 4 | * 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * * Neither the name of Poly2Tri nor the names of its contributors may be 16 | * used to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | #include "cdt.h" 32 | 33 | namespace p2t { 34 | 35 | CDT::CDT(std::vector polyline) 36 | { 37 | sweep_context_ = new SweepContext(polyline); 38 | sweep_ = new Sweep; 39 | } 40 | 41 | void CDT::AddHole(std::vector polyline) 42 | { 43 | sweep_context_->AddHole(polyline); 44 | } 45 | 46 | void CDT::AddPoint(Point* point) { 47 | sweep_context_->AddPoint(point); 48 | } 49 | 50 | void CDT::Triangulate() 51 | { 52 | sweep_->Triangulate(*sweep_context_); 53 | } 54 | 55 | std::vector CDT::GetTriangles() 56 | { 57 | return sweep_context_->GetTriangles(); 58 | } 59 | 60 | std::list CDT::GetMap() 61 | { 62 | return sweep_context_->GetMap(); 63 | } 64 | 65 | CDT::~CDT() 66 | { 67 | delete sweep_context_; 68 | delete sweep_; 69 | } 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /polygon/poly2tri/sweep/sweep.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/polygon/poly2tri/sweep/sweep.h -------------------------------------------------------------------------------- /potrace/AUTHORS: -------------------------------------------------------------------------------- 1 | Known contributors are listed here, in alphabetical order by their 2 | abbreviations (which are used in Changelog). 3 | 4 | PS1 Peter Selinger (author) 5 | TA1 Tor Andersson 6 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/3.10.3/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/Library/Developer/CommandLineTools/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "AppleClang") 4 | set(CMAKE_C_COMPILER_VERSION "7.0.2.7000181") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Darwin") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_SIMULATE_VERSION "") 16 | 17 | 18 | 19 | set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") 20 | set(CMAKE_C_COMPILER_AR "") 21 | set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") 22 | set(CMAKE_C_COMPILER_RANLIB "") 23 | set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") 24 | set(CMAKE_COMPILER_IS_GNUCC ) 25 | set(CMAKE_C_COMPILER_LOADED 1) 26 | set(CMAKE_C_COMPILER_WORKS TRUE) 27 | set(CMAKE_C_ABI_COMPILED TRUE) 28 | set(CMAKE_COMPILER_IS_MINGW ) 29 | set(CMAKE_COMPILER_IS_CYGWIN ) 30 | if(CMAKE_COMPILER_IS_CYGWIN) 31 | set(CYGWIN 1) 32 | set(UNIX 1) 33 | endif() 34 | 35 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 36 | 37 | if(CMAKE_COMPILER_IS_MINGW) 38 | set(MINGW 1) 39 | endif() 40 | set(CMAKE_C_COMPILER_ID_RUN 1) 41 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 42 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 43 | set(CMAKE_C_LINKER_PREFERENCE 10) 44 | 45 | # Save compiler ABI information. 46 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 47 | set(CMAKE_C_COMPILER_ABI "") 48 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 49 | 50 | if(CMAKE_C_SIZEOF_DATA_PTR) 51 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 52 | endif() 53 | 54 | if(CMAKE_C_COMPILER_ABI) 55 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 56 | endif() 57 | 58 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 59 | set(CMAKE_LIBRARY_ARCHITECTURE "") 60 | endif() 61 | 62 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 63 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 64 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 65 | endif() 66 | 67 | 68 | 69 | 70 | 71 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") 72 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib;/usr/local/lib") 73 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Frameworks;/System/Library/Frameworks") 74 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/3.10.3/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/potrace/CMakeFiles/3.10.3/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /potrace/CMakeFiles/3.10.3/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/potrace/CMakeFiles/3.10.3/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /potrace/CMakeFiles/3.10.3/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Darwin-14.5.0") 2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin") 3 | set(CMAKE_HOST_SYSTEM_VERSION "14.5.0") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Darwin-14.5.0") 9 | set(CMAKE_SYSTEM_NAME "Darwin") 10 | set(CMAKE_SYSTEM_VERSION "14.5.0") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/3.10.3/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/potrace/CMakeFiles/3.10.3/CompilerIdC/a.out -------------------------------------------------------------------------------- /potrace/CMakeFiles/3.10.3/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/potrace/CMakeFiles/3.10.3/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /potrace/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.10 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/xcorex/kicad-source-mirror/potrace") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/xcorex/kicad-source-mirror/potrace") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/rebuild_cache.dir 2 | /Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/edit_cache.dir 3 | /Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir 4 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/potrace/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /potrace/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/Users/xcorex/kicad-source-mirror/potrace/bitmap_io.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/bitmap_io.o" 8 | "/Users/xcorex/kicad-source-mirror/potrace/curve.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/curve.o" 9 | "/Users/xcorex/kicad-source-mirror/potrace/decompose.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/decompose.o" 10 | "/Users/xcorex/kicad-source-mirror/potrace/greymap.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/greymap.o" 11 | "/Users/xcorex/kicad-source-mirror/potrace/potracelib.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/potracelib.o" 12 | "/Users/xcorex/kicad-source-mirror/potrace/render.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/render.o" 13 | "/Users/xcorex/kicad-source-mirror/potrace/trace.cpp" "/Users/xcorex/kicad-source-mirror/potrace/CMakeFiles/potrace.dir/trace.o" 14 | ) 15 | set(CMAKE_CXX_COMPILER_ID "Clang") 16 | 17 | # The include file search paths: 18 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 19 | ) 20 | 21 | # Targets to which this target links. 22 | set(CMAKE_TARGET_LINKED_INFO_FILES 23 | ) 24 | 25 | # Fortran module output directory. 26 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 27 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/potrace.dir/bitmap_io.o" 3 | "CMakeFiles/potrace.dir/curve.o" 4 | "CMakeFiles/potrace.dir/decompose.o" 5 | "CMakeFiles/potrace.dir/greymap.o" 6 | "CMakeFiles/potrace.dir/potracelib.o" 7 | "CMakeFiles/potrace.dir/render.o" 8 | "CMakeFiles/potrace.dir/trace.o" 9 | "libpotrace.pdb" 10 | "libpotrace.a" 11 | ) 12 | 13 | # Per-language clean rules from dependency scanning. 14 | foreach(lang CXX) 15 | include(CMakeFiles/potrace.dir/cmake_clean_${lang}.cmake OPTIONAL) 16 | endforeach() 17 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libpotrace.a" 3 | ) 4 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.10 3 | 4 | CMakeFiles/potrace.dir/bitmap_io.o: bitmap.h 5 | CMakeFiles/potrace.dir/bitmap_io.o: bitmap_io.cpp 6 | CMakeFiles/potrace.dir/bitmap_io.o: potracelib.h 7 | 8 | CMakeFiles/potrace.dir/curve.o: auxiliary.h 9 | CMakeFiles/potrace.dir/curve.o: curve.cpp 10 | CMakeFiles/potrace.dir/curve.o: curve.h 11 | CMakeFiles/potrace.dir/curve.o: lists.h 12 | CMakeFiles/potrace.dir/curve.o: potracelib.h 13 | 14 | CMakeFiles/potrace.dir/decompose.o: auxiliary.h 15 | CMakeFiles/potrace.dir/decompose.o: bitmap.h 16 | CMakeFiles/potrace.dir/decompose.o: curve.h 17 | CMakeFiles/potrace.dir/decompose.o: decompose.cpp 18 | CMakeFiles/potrace.dir/decompose.o: decompose.h 19 | CMakeFiles/potrace.dir/decompose.o: lists.h 20 | CMakeFiles/potrace.dir/decompose.o: potracelib.h 21 | CMakeFiles/potrace.dir/decompose.o: progress.h 22 | 23 | CMakeFiles/potrace.dir/greymap.o: greymap.cpp 24 | CMakeFiles/potrace.dir/greymap.o: greymap.h 25 | 26 | CMakeFiles/potrace.dir/potracelib.o: auxiliary.h 27 | CMakeFiles/potrace.dir/potracelib.o: curve.h 28 | CMakeFiles/potrace.dir/potracelib.o: decompose.h 29 | CMakeFiles/potrace.dir/potracelib.o: potrace_version.h 30 | CMakeFiles/potrace.dir/potracelib.o: potracelib.cpp 31 | CMakeFiles/potrace.dir/potracelib.o: potracelib.h 32 | CMakeFiles/potrace.dir/potracelib.o: progress.h 33 | CMakeFiles/potrace.dir/potracelib.o: trace.h 34 | 35 | CMakeFiles/potrace.dir/render.o: auxiliary.h 36 | CMakeFiles/potrace.dir/render.o: greymap.h 37 | CMakeFiles/potrace.dir/render.o: potracelib.h 38 | CMakeFiles/potrace.dir/render.o: render.cpp 39 | CMakeFiles/potrace.dir/render.o: render.h 40 | 41 | CMakeFiles/potrace.dir/trace.o: auxiliary.h 42 | CMakeFiles/potrace.dir/trace.o: curve.h 43 | CMakeFiles/potrace.dir/trace.o: lists.h 44 | CMakeFiles/potrace.dir/trace.o: potracelib.h 45 | CMakeFiles/potrace.dir/trace.o: progress.h 46 | CMakeFiles/potrace.dir/trace.o: trace.cpp 47 | CMakeFiles/potrace.dir/trace.o: trace.h 48 | 49 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.10 3 | 4 | # compile CXX with /Library/Developer/CommandLineTools/usr/bin/c++ 5 | CXX_FLAGS = 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = 10 | 11 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/link.txt: -------------------------------------------------------------------------------- 1 | /Library/Developer/CommandLineTools/usr/bin/ar qc libpotrace.a CMakeFiles/potrace.dir/bitmap_io.o CMakeFiles/potrace.dir/curve.o CMakeFiles/potrace.dir/decompose.o CMakeFiles/potrace.dir/greymap.o CMakeFiles/potrace.dir/potracelib.o CMakeFiles/potrace.dir/render.o CMakeFiles/potrace.dir/trace.o 2 | /Library/Developer/CommandLineTools/usr/bin/ranlib libpotrace.a 3 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/potrace.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | CMAKE_PROGRESS_4 = 4 5 | CMAKE_PROGRESS_5 = 5 6 | CMAKE_PROGRESS_6 = 6 7 | CMAKE_PROGRESS_7 = 7 8 | CMAKE_PROGRESS_8 = 8 9 | 10 | -------------------------------------------------------------------------------- /potrace/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /potrace/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(BEFORE ${INC_BEFORE}) 2 | include_directories( 3 | ${INC_AFTER} 4 | ) 5 | 6 | set(POTRACE_SRCS 7 | bitmap_io.cpp 8 | curve.cpp 9 | decompose.cpp 10 | greymap.cpp 11 | potracelib.cpp 12 | render.cpp 13 | trace.cpp 14 | ) 15 | 16 | add_library(potrace STATIC ${POTRACE_SRCS}) 17 | -------------------------------------------------------------------------------- /potrace/bitmap_io.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | * This file is part of Potrace. It is free software and it is covered 3 | * by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* $Id: bitmap_io.h 147 2007-04-09 00:44:09Z selinger $ */ 6 | /* bitmap input/output functions */ 7 | 8 | #ifndef BITMAP_IO_H 9 | #define BITMAP_IO_H 10 | 11 | #include 12 | #include 13 | 14 | /* Note that bitmaps are stored bottom to top, i.e., the first 15 | * scanline is the bottom-most one */ 16 | 17 | extern char* bm_read_error; 18 | 19 | int bm_read( FILE* f, double blacklevel, potrace_bitmap_t** bmp ); 20 | void bm_writepbm( FILE* f, potrace_bitmap_t* bm ); 21 | int bm_print( FILE* f, potrace_bitmap_t* bm ); 22 | 23 | #endif /* BITMAP_IO_H */ 24 | -------------------------------------------------------------------------------- /potrace/bitops.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | This file is part of Potrace. It is free software and it is covered 3 | by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* $Id: bitops.h 147 2007-04-09 00:44:09Z selinger $ */ 6 | 7 | /* bits.h: this file defines some macros for bit manipulations. We 8 | provide a generic implementation */ 9 | 10 | /* lobit: return the position of the rightmost "1" bit of an int, or 11 | 32 if none. hibit: return 1 + the position of the leftmost "1" bit 12 | of an int, or 0 if none. Note: these functions work on 32-bit 13 | integers. */ 14 | 15 | #ifndef BITOPS_H 16 | #define BITOPS_H 17 | 18 | #ifdef HAVE_CONFIG_H 19 | #include 20 | #endif 21 | 22 | /* generic macros */ 23 | 24 | static inline unsigned int lobit(unsigned int x) { 25 | unsigned int res = 32; 26 | while (x & 0xffffff) { 27 | x <<= 8; 28 | res -= 8; 29 | } 30 | while (x) { 31 | x <<= 1; 32 | res -= 1; 33 | } 34 | return res; 35 | } 36 | 37 | static inline unsigned int hibit(unsigned int x) { 38 | unsigned int res = 0; 39 | while (x > 0xff) { 40 | x >>= 8; 41 | res += 8; 42 | } 43 | while (x) { 44 | x >>= 1; 45 | res += 1; 46 | } 47 | return res; 48 | } 49 | 50 | #endif /* BITOPS_H */ 51 | -------------------------------------------------------------------------------- /potrace/decompose.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | * This file is part of Potrace. It is free software and it is covered 3 | * by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* $Id: decompose.h 147 2007-04-09 00:44:09Z selinger $ */ 6 | 7 | #ifndef DECOMPOSE_H 8 | #define DECOMPOSE_H 9 | 10 | #include "potracelib.h" 11 | #include "progress.h" 12 | 13 | int bm_to_pathlist( const potrace_bitmap_t* bm, 14 | path_t** plistp, 15 | const potrace_param_t* param, 16 | progress_t* progress ); 17 | 18 | #endif /* DECOMPOSE_H */ 19 | -------------------------------------------------------------------------------- /potrace/greymap.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | This file is part of Potrace. It is free software and it is covered 3 | by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* $Id: greymap.h 147 2007-04-09 00:44:09Z selinger $ */ 6 | 7 | #ifndef PGM_H 8 | #define PGM_H 9 | 10 | #include 11 | 12 | /* internal format for greymaps. Note: in this format, rows are 13 | ordered from bottom to top. The pixels in each row are given from 14 | left to right. */ 15 | 16 | struct greymap_s { 17 | int w; /* width, in pixels */ 18 | int h; /* height, in pixels */ 19 | signed short int *map; /* raw data, w*h values */ 20 | }; 21 | typedef struct greymap_s greymap_t; 22 | 23 | /* macros for accessing pixel at index (x,y). Note that the origin is 24 | in the *lower* left corner. U* macros omit the bounds check. */ 25 | 26 | #define gm_index(gm, x, y) (&(gm)->map[(x)+(y)*(gm)->w]) 27 | #define gm_safe(gm, x, y) ((int)(x)>=0 && (int)(x)<(gm)->w && (int)(y)>=0 && (int)(y)<(gm)->h) 28 | #define gm_bound(x, m) ((x)<0 ? 0 : (x)>=(m) ? (m)-1 : (x)) 29 | #define GM_UGET(gm, x, y) (*gm_index(gm, x, y)) 30 | #define GM_UINC(gm, x, y, b) (*gm_index(gm, x, y) += (short int)(b)) 31 | #define GM_UINV(gm, x, y) (*gm_index(gm, x, y) = 255 - *gm_index(gm, x, y)) 32 | #define GM_UPUT(gm, x, y, b) (*gm_index(gm, x, y) = (short int)(b)) 33 | #define GM_GET(gm, x, y) (gm_safe(gm, x, y) ? GM_UGET(gm, x, y) : 0) 34 | #define GM_INC(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UINC(gm, x, y, b) : 0) 35 | #define GM_INV(gm, x, y) (gm_safe(gm, x, y) ? GM_UINV(gm, x, y) : 0) 36 | #define GM_PUT(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UPUT(gm, x, y, b) : 0) 37 | #define GM_BGET(gm, x, y) GM_UGET(gm, gm_bound(x, gm->w), gm_bound(y, gm->h)) 38 | 39 | /* modes for cutting off out-of-range values. The following names 40 | refer to winding numbers. I.e., make a pixel black if winding 41 | number is nonzero, odd, or positive, respectively. We assume that 0 42 | winding number corresponds to white (255). */ 43 | #define GM_MODE_NONZERO 1 44 | #define GM_MODE_ODD 2 45 | #define GM_MODE_POSITIVE 3 46 | #define GM_MODE_NEGATIVE 4 47 | 48 | extern const char *gm_read_error; 49 | 50 | greymap_t *gm_new(int w, int h); 51 | greymap_t *gm_dup(greymap_t *gm); 52 | void gm_free(greymap_t *gm); 53 | void gm_clear(greymap_t *gm, int b); 54 | int gm_read(FILE *f, greymap_t **gmp); 55 | int gm_writepgm(FILE *f, greymap_t *gm, char *comment, int raw, int mode, double gamma); 56 | int gm_print(FILE *f, greymap_t *gm); 57 | 58 | #endif /* PGM_H */ 59 | -------------------------------------------------------------------------------- /potrace/libpotrace.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/potrace/libpotrace.a -------------------------------------------------------------------------------- /potrace/platform.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | * This file is part of Potrace. It is free software and it is covered 3 | * by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* this header file contains some platform dependent stuff */ 6 | 7 | #ifndef PLATFORM_H 8 | #define PLATFORM_H 9 | 10 | #ifdef HAVE_CONFIG_H 11 | #include 12 | #endif 13 | 14 | /* in Windows, set all file i/o to binary */ 15 | #ifdef __MINGW32__ 16 | #include 17 | unsigned int _CRT_fmode = _O_BINARY; 18 | #endif 19 | 20 | #ifdef __CYGWIN__ 21 | #include 22 | #include 23 | static inline void platform_init( void ) 24 | { 25 | setmode( 0, O_BINARY ); 26 | setmode( 1, O_BINARY ); 27 | } 28 | 29 | 30 | #else 31 | static inline void platform_init( void ) 32 | { 33 | /* NOP */ 34 | } 35 | 36 | 37 | #endif 38 | 39 | #endif /* PLATFORM_H */ 40 | -------------------------------------------------------------------------------- /potrace/potrace_version.h: -------------------------------------------------------------------------------- 1 | #define POTRACELIB_VERSION "potracelib 1.8" 2 | -------------------------------------------------------------------------------- /potrace/render.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | * This file is part of Potrace. It is free software and it is covered 3 | * by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* $Id: render.h 147 2007-04-09 00:44:09Z selinger $ */ 6 | 7 | #ifndef RENDER_H 8 | #define RENDER_H 9 | 10 | #include "greymap.h" 11 | 12 | struct render_s 13 | { 14 | greymap_t* gm; 15 | double x0, y0, x1, y1; 16 | int x0i, y0i, x1i, y1i; 17 | double a0, a1; 18 | int* incrow_buf; 19 | }; 20 | typedef struct render_s render_t; 21 | 22 | render_t* render_new( greymap_t* gm ); 23 | void render_free( render_t* rm ); 24 | void render_close( render_t* rm ); 25 | void render_moveto( render_t* rm, double x, double y ); 26 | void render_lineto( render_t* rm, double x, double y ); 27 | void render_curveto( render_t* rm, 28 | double x2, 29 | double y2, 30 | double x3, 31 | double y3, 32 | double x4, 33 | double y4 ); 34 | 35 | #endif /* RENDER_H */ 36 | -------------------------------------------------------------------------------- /potrace/trace.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2001-2007 Peter Selinger. 2 | * This file is part of Potrace. It is free software and it is covered 3 | * by the GNU General Public License. See the file COPYING for details. */ 4 | 5 | /* $Id: trace.h 147 2007-04-09 00:44:09Z selinger $ */ 6 | 7 | #ifndef TRACE_H 8 | #define TRACE_H 9 | 10 | #include "potracelib.h" 11 | #include "progress.h" 12 | 13 | int process_path( path_t* plist, const potrace_param_t* param, progress_t* progress ); 14 | 15 | #endif /* TRACE_H */ 16 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories( BEFORE ${INC_BEFORE} ) 3 | include_directories( 4 | ../potrace 5 | ../common 6 | ../polygon 7 | ${INC_AFTER} 8 | ) 9 | 10 | set( BITMAP2COMPONENT_SRCS 11 | ../common/single_top.cpp 12 | bitmap2component.cpp 13 | bitmap2cmp_gui_base 14 | bitmap2cmp_gui 15 | ) 16 | 17 | set_source_files_properties( ../common/single_top.cpp PROPERTIES 18 | COMPILE_DEFINITIONS "TOP_FRAME=FRAME_BM2CMP" 19 | ) 20 | set_source_files_properties( bitmap2cmp_gui.cpp PROPERTIES 21 | COMPILE_DEFINITIONS "COMPILING_DLL" 22 | ) 23 | 24 | if( MINGW ) 25 | # BITMAP2COMPONENT_RESOURCES variable is set by the macro. 26 | mingw_resource_compiler( bitmap2component ) 27 | else() 28 | set( BITMAP2COMPONENT_RESOURCES bitmap2component.rc ) 29 | endif() 30 | 31 | if( APPLE ) 32 | # setup bundle 33 | set( BITMAP2COMPONENT_RESOURCES bitmap2component.icns ) 34 | set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/bitmap2component.icns" PROPERTIES 35 | MACOSX_PACKAGE_LOCATION Resources 36 | ) 37 | set( MACOSX_BUNDLE_ICON_FILE bitmap2component.icns ) 38 | set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-pcb.kicad ) 39 | set( MACOSX_BUNDLE_NAME bitmap2component ) 40 | endif() 41 | 42 | add_executable( bitmap2component WIN32 MACOSX_BUNDLE 43 | ${BITMAP2COMPONENT_SRCS} 44 | ${BITMAP2COMPONENT_RESOURCES} 45 | ) 46 | 47 | target_link_libraries( bitmap2component 48 | common 49 | polygon 50 | bitmaps 51 | ${wxWidgets_LIBRARIES} 52 | potrace 53 | ) 54 | 55 | if( APPLE ) 56 | 57 | else() 58 | install( TARGETS bitmap2component 59 | DESTINATION ${KICAD_BIN} 60 | COMPONENT binary 61 | ) 62 | endif() 63 | 64 | 65 | if( false ) # linker map with cross reference 66 | set_target_properties( bitmap2component PROPERTIES 67 | LINK_FLAGS "${TO_LINKER},-cref ${TO_LINKER},-Map=bitmap2component.map" 68 | ) 69 | endif() 70 | -------------------------------------------------------------------------------- /src/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDocumentTypes 6 | 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | bitmap2component 11 | CFBundleGetInfoString 12 | 13 | CFBundleIconFile 14 | bitmap2component.icns 15 | CFBundleIdentifier 16 | org.kicad-pcb.bitmap2component 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleLongVersionString 20 | 21 | CFBundleName 22 | bitmap2component 23 | CFBundlePackageType 24 | APPL 25 | CFBundleShortVersionString 26 | 27 | CFBundleSignature 28 | ???? 29 | CFBundleVersion 30 | 31 | CSResourcesFileMapped 32 | 33 | LSRequiresCarbon 34 | 35 | NSHumanReadableCopyright 36 | 37 | NSHighResolutionCapable 38 | True 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/bitmap2component: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/src/bitmap2component -------------------------------------------------------------------------------- /src/bitmap2component.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program source code file is part of KICAD, a free EDA CAD application. 3 | * 4 | * Copyright (C) 1992-2014 Kicad Developers, see change_log.txt for contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, you may find one here: 18 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 | * or you may search the http://www.gnu.org website for the version 2 license, 20 | * or you may write to the Free Software Foundation, Inc., 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 22 | */ 23 | 24 | #ifndef BITMAP2COMPONENT_H 25 | #define BITMAP2COMPONENT_H 26 | 27 | // for consistency this enum should conform to the 28 | // indices in m_radioBoxFormat from bitmap2cmp_gui.cpp 29 | enum OUTPUT_FMT_ID 30 | { 31 | EESCHEMA_FMT = 0, 32 | PCBNEW_KICAD_MOD, 33 | POSTSCRIPT_FMT, 34 | KICAD_LOGO, 35 | FINAL_FMT = KICAD_LOGO 36 | }; 37 | 38 | enum BMP2CMP_MOD_LAYER 39 | { 40 | MOD_LYR_FSILKS = 0, 41 | MOD_LYR_BSILKS, 42 | MOD_LYR_FSOLDERMASK, 43 | MOD_LYR_ECO1, 44 | MOD_LYR_ECO2, 45 | MOD_LYR_FINAL = MOD_LYR_ECO2, 46 | MOD_LYR_FCU, 47 | MOD_LYR_BCU, 48 | MOD_LYR_FMASK, 49 | MOD_LYR_BMASK 50 | }; 51 | 52 | #endif // BITMAP2COMPONENT_H 53 | -------------------------------------------------------------------------------- /src/bitmap2component.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/src/bitmap2component.icns -------------------------------------------------------------------------------- /src/bitmap2component.rc: -------------------------------------------------------------------------------- 1 | icon_bitmap2component ICON "../bitmaps_png/icons/icon_bitmap2component.ico" 2 | 3 | #include "wx/msw/wx.rc" 4 | -------------------------------------------------------------------------------- /src/build.sh: -------------------------------------------------------------------------------- 1 | rm -fr *.o 2 | g++ -c ../common/geometry/* -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -v -std=c++11 3 | g++ -c ../common/math/* -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -v -std=c++11 4 | g++ -c ../polygon/* -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -v -std=c++11 5 | g++ -c main.cpp bitmap2component.cpp lodepng.cpp -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -L ../common/ -I ../common/ -std=c++11 6 | g++ -o bitmap2component *.o -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -L ../common/ -I ../common/ -std=c++11 7 | -------------------------------------------------------------------------------- /src/build_win.sh: -------------------------------------------------------------------------------- 1 | rm -fr *.o 2 | g++ -c ../common/geometry/* -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -v -std=c++11 3 | g++ -c ../common/math/* -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -v -std=c++11 4 | g++ -c ../polygon/* -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -v -std=c++11 5 | g++ -c main.cpp bitmap2component.cpp lodepng.cpp -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -L ../common/ -I ../common/ -std=c++11 6 | g++ -o bitmap2component *.o -lpotrace -L. -L../potrace -I../include -I../polygon -I../potrace -I. -L ../common/ -I ../common/ -std=c++11 -static-libgcc -static-libstdc++ -static 7 | -------------------------------------------------------------------------------- /src/myfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/src/myfile.txt -------------------------------------------------------------------------------- /src/test-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/src/test-a.png -------------------------------------------------------------------------------- /src/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badgeek/svg2shenzhen/8ac233113a1ac6fd9a4599e3eeb6edf478a8903f/src/test.png --------------------------------------------------------------------------------