-Changes to header files to support parsing

-Added header parser and docstring generator
This commit is contained in:
Sebastian Koch
2016-05-12 15:36:04 +02:00
parent 4baa661e5c
commit e879d27f15
17 changed files with 993 additions and 900 deletions
+632 -409
View File
File diff suppressed because it is too large Load Diff
+49 -405
View File
@@ -1,409 +1,53 @@
extern const char *__doc_igl_AABB;
extern const char *__doc_igl_active_set;
extern const char *__doc_igl_adjacency_list;
extern const char *__doc_igl_adjacency_matrix;
extern const char *__doc_igl_all_edges;
extern const char *__doc_igl_all_pairs_distances;
extern const char *__doc_igl_angle_bound_frame_fields;
extern const char *__doc_igl_angular_distance;
extern const char *__doc_igl_any_of;
extern const char *__doc_igl_arap;
extern const char *__doc_igl_ARAPEnergyType;
extern const char *__doc_igl_arap_dof;
extern const char *__doc_igl_arap_linear_block;
extern const char *__doc_igl_arap_rhs;
extern const char *__doc_igl_average_onto_faces;
extern const char *__doc_igl_average_onto_vertices;
extern const char *__doc_igl_avg_edge_length;
extern const char *__doc_igl_axis_angle_to_quat;
extern const char *__doc_igl_barycenter;
extern const char *__doc_igl_barycentric_coordinates;
extern const char *__doc_igl_barycentric_to_global;
extern const char *__doc_igl_basename;
extern const char *__doc_igl_bfs_orient;
extern const char *__doc_igl_biharmonic_coordinates;
extern const char *__doc_igl_bone_parents;
extern const char *__doc_igl_boundary_conditions;
extern const char *__doc_igl_boundary_facets;
extern const char *__doc_igl_boundary_loop;
extern const char *__doc_igl_bounding_box;
extern const char *__doc_igl_bounding_box_diagonal;
extern const char *__doc_igl_Camera;
extern const char *__doc_igl_canonical_quaternions;
extern const char *__doc_igl_cat;
extern const char *__doc_igl_ceil;
extern const char *__doc_igl_centroid;
extern const char *__doc_igl_circulation;
extern const char *__doc_igl_collapse_edge;
extern const char *__doc_igl_collapse_small_triangles;
extern const char *__doc_igl_colon;
extern const char *__doc_igl_columnize;
extern const char *__doc_igl_column_to_quats;
extern const char *__doc_igl_comb_cross_field;
extern const char *__doc_igl_comb_frame_field;
extern const char *__doc_igl_comb_line_field;
extern const char *__doc_igl_components;
extern const char *__doc_igl_compute_frame_field_bisectors;
extern const char *__doc_igl_ConjugateFFSolverData;
extern const char *__doc_igl_conjugate_frame_fields;
extern const char *__doc_igl_cotmatrix;
extern const char *__doc_igl_cotmatrix_entries;
extern const char *__doc_igl_covariance_scatter_matrix;
extern const char *__doc_igl_cross;
extern const char *__doc_igl_cross_field_missmatch;
extern const char *__doc_igl_crouzeix_raviart_massmatrix;
extern const char *__doc_igl_cumsum;
extern const char *__doc_igl_cut_mesh;
extern const char *__doc_igl_cut_mesh_from_singularities;
extern const char *__doc_igl_C_STR;
extern const char *__doc_igl_dated_copy;
extern const char *__doc_igl_decimate;
extern const char *__doc_igl_deform_skeleton;
extern const char *__doc_igl_deprecated;
extern const char *__doc_igl_diag;
extern const char *__doc_igl_dihedral_angles;
extern const char *__doc_igl_dijkstra;
extern const char *__doc_igl_directed_edge_orientations;
extern const char *__doc_igl_directed_edge_parents;
extern const char *__doc_igl_dirname;
extern const char *__doc_igl_dot;
extern const char *__doc_igl_dot_row;
extern const char *__doc_igl_doublearea;
extern const char *__doc_igl_dqs;
extern const char *__doc_igl_edges;
extern const char *__doc_igl_edge_collapse_is_valid;
extern const char *__doc_igl_edge_flaps;
extern const char *__doc_igl_edge_lengths;
extern const char *__doc_igl_edge_topology;
extern const char *__doc_igl_eigs;
extern const char *__doc_igl_EPS;
extern const char *__doc_igl_example_fun;
extern const char *__doc_igl_exterior_edges;
extern const char *__doc_igl_faces_first;
extern const char *__doc_igl_facet_components;
extern const char *__doc_igl_face_areas;
extern const char *__doc_igl_face_occurrences;
extern const char *__doc_igl_false_barycentric_subdivision;
extern const char *__doc_igl_field_local_global_conversions;
extern const char *__doc_igl_file_contents_as_string;
extern const char *__doc_igl_file_dialog_open;
extern const char *__doc_igl_file_dialog_save;
extern const char *__doc_igl_file_exists;
extern const char *__doc_igl_find;
extern const char *__doc_igl_find_cross_field_singularities;
extern const char *__doc_igl_fit_plane;
extern const char *__doc_igl_fit_rigid;
extern const char *__doc_igl_fit_rotations;
extern const char *__doc_igl_floor;
extern const char *__doc_igl_forward_kinematics;
extern const char *__doc_igl_frame_field_deformer;
extern const char *__doc_igl_frame_to_cross_field;
extern const char *__doc_igl_frustum;
extern const char *__doc_igl_full;
extern const char *__doc_igl_gaussian_curvature;
extern const char *__doc_igl_get_seconds;
extern const char *__doc_igl_get_seconds_hires;
extern const char *__doc_igl_grad;
extern const char *__doc_igl_group_sum_matrix;
extern const char *__doc_igl_HalfEdgeIterator;
extern const char *__doc_igl_harmonic;
extern const char *__doc_igl_harwell_boeing;
extern const char *__doc_igl_histc;
extern const char *__doc_igl_hsv_to_rgb;
extern const char *__doc_igl_igl_inline;
extern const char *__doc_igl_IndexComparison;
extern const char *__doc_igl_integrable_polyvector_fields;
extern const char *__doc_igl_internal_angles;
extern const char *__doc_igl_intersect;
extern const char *__doc_igl_invert_diag;
extern const char *__doc_igl_in_element;
extern const char *__doc_igl_is_border_vertex;
extern const char *__doc_igl_is_boundary_edge;
extern const char *__doc_igl_is_dir;
extern const char *__doc_igl_is_edge_manifold;
extern const char *__doc_igl_is_file;
extern const char *__doc_igl_is_irregular_vertex;
extern const char *__doc_igl_is_planar;
extern const char *__doc_igl_is_readable;
extern const char *__doc_igl_is_sparse;
extern const char *__doc_igl_is_symmetric;
extern const char *__doc_igl_is_vertex_manifold;
extern const char *__doc_igl_is_writable;
extern const char *__doc_igl_jet;
extern const char *__doc_igl_launch_medit;
extern const char *__doc_igl_lbs_matrix;
extern const char *__doc_igl_limit_faces;
extern const char *__doc_igl_line_field_missmatch;
extern const char *__doc_igl_line_segment_in_rectangle;
extern const char *__doc_igl_linprog;
extern const char *__doc_igl_list_to_matrix;
extern const char *__doc_igl_local_basis;
extern const char *__doc_igl_look_at;
extern const char *__doc_igl_lscm;
extern const char *__doc_igl_lu_lagrange;
extern const char *__doc_igl_map_vertices_to_circle;
extern const char *__doc_igl_marching_cubes;
extern const char *__doc_igl_massmatrix;
extern const char *__doc_igl_material_colors;
extern const char *__doc_igl_matlab_format;
extern const char *__doc_igl_matrix_to_list;
extern const char *__doc_igl_mat_max;
extern const char *__doc_igl_mat_min;
extern const char *__doc_igl_mat_to_quat;
extern const char *__doc_igl_max_size;
extern const char *__doc_igl_median;
extern const char *__doc_igl_min_quad_dense;
extern const char *__doc_igl_min_quad_with_fixed;
extern const char *__doc_igl_min_size;
extern const char *__doc_igl_mod;
extern const char *__doc_igl_mode;
extern const char *__doc_igl_mvc;
extern const char *__doc_igl_nchoosek;
extern const char *__doc_igl_next_filename;
extern const char *__doc_igl_normalize_quat;
extern const char *__doc_igl_normalize_row_lengths;
extern const char *__doc_igl_normalize_row_sums;
extern const char *__doc_igl_NormalType;
extern const char *__doc_igl_normal_derivative;
extern const char *__doc_igl_null;
extern const char *__doc_igl_n_polyvector;
extern const char *__doc_igl_n_polyvector_general;
extern const char *__doc_igl_ONE;
extern const char *__doc_igl_on_boundary;
extern const char *__doc_igl_orientable_patches;
extern const char *__doc_igl_orient_outward;
extern const char *__doc_igl_orth;
extern const char *__doc_igl_ortho;
extern const char *__doc_igl_outer_facet;
extern const char *__doc_igl_parallel_transport_angles;
extern const char *__doc_igl_partition;
extern const char *__doc_igl_parula;
extern const char *__doc_igl_pathinfo;
extern const char *__doc_igl_path_to_executable;
extern const char *__doc_igl_per_corner_normals;
extern const char *__doc_igl_per_edge_normals;
extern const char *__doc_igl_per_face_normals;
extern const char *__doc_igl_per_vertex_attribute_smoothing;
extern const char *__doc_igl_per_vertex_normals;
extern const char *__doc_igl_PI;
extern const char *__doc_igl_planarize_quad_mesh;
extern const char *__doc_igl_ply;
extern const char *__doc_igl_point_in_circle;
extern const char *__doc_igl_point_in_poly;
extern const char *__doc_igl_point_mesh_squared_distance;
extern const char *__doc_igl_polar_dec;
extern const char *__doc_igl_polar_svd;
extern const char *__doc_igl_polar_svd3x3;
extern const char *__doc_igl_polygon_mesh_to_triangle_mesh;
extern const char *__doc_igl_polyroots;
extern const char *__doc_igl_polyvector_field_comb_from_matchings_and_cuts;
extern const char *__doc_igl_polyvector_field_cut_mesh_with_singularities;
extern const char *__doc_igl_polyvector_field_matchings;
extern const char *__doc_igl_polyvector_field_poisson_reconstruction;
extern const char *__doc_igl_polyvector_field_singularities_from_matchings;
extern const char *__doc_igl_principal_curvature;
extern const char *__doc_igl_print_ijv;
extern const char *__doc_igl_print_vector;
extern const char *__doc_igl_procrustes;
extern const char *__doc_igl_project;
extern const char *__doc_igl_project_isometrically_to_plane;
extern const char *__doc_igl_project_to_line;
extern const char *__doc_igl_project_to_line_segment;
extern const char *__doc_igl_pseudonormal_test;
extern const char *__doc_igl_quad_planarity;
extern const char *__doc_igl_quats_to_column;
extern const char *__doc_igl_quat_conjugate;
extern const char *__doc_igl_quat_mult;
extern const char *__doc_igl_quat_to_axis_angle;
extern const char *__doc_igl_quat_to_mat;
extern const char *__doc_igl_random_dir;
extern const char *__doc_igl_random_points_on_mesh;
extern const char *__doc_igl_random_quaternion;
extern const char *__doc_igl_randperm;
extern const char *__doc_igl_ray_sphere_intersect;
extern const char *__doc_igl_readCSV;
extern const char *__doc_igl_readDMAT;
extern const char *__doc_igl_readMESH;
extern const char *__doc_igl_readNODE;
extern const char *__doc_igl_readOBJ;
extern const char *__doc_igl_readOFF;
extern const char *__doc_igl_readPLY;
extern const char *__doc_igl_readSTL;
extern const char *__doc_igl_readTGF;
extern const char *__doc_igl_readWRL;
extern const char *__doc_igl_read_triangle_mesh;
extern const char *__doc_igl_REDRUM;
extern const char *__doc_igl_remove_duplicates;
extern const char *__doc_igl_remove_duplicate_vertices;
extern const char *__doc_igl_remove_unreferenced;
extern const char *__doc_igl_reorder;
extern const char *__doc_igl_repdiag;
extern const char *__doc_igl_repmat;
extern const char *__doc_igl_rgb_to_hsv;
extern const char *__doc_igl_rotate_by_quat;
extern const char *__doc_igl_rotate_vectors;
extern const char *__doc_igl_rotation_matrix_from_directions;
extern const char *__doc_igl_round;
extern const char *__doc_igl_rows_to_matrix;
extern const char *__doc_igl_sample_edges;
extern const char *__doc_igl_serialize;
extern const char *__doc_igl_setdiff;
extern const char *__doc_igl_signed_distance;
extern const char *__doc_igl_local_basis;
extern const char *__doc_igl_cotmatrix;
extern const char *__doc_igl_floor;
extern const char *__doc_igl_slice;
extern const char *__doc_igl_slice_into;
extern const char *__doc_igl_slice_mask;
extern const char *__doc_igl_slice_tets;
extern const char *__doc_igl_snap_points;
extern const char *__doc_igl_snap_to_canonical_view_quat;
extern const char *__doc_igl_snap_to_fixed_up;
extern const char *__doc_igl_SolverStatus;
extern const char *__doc_igl_sort;
extern const char *__doc_igl_SortableRow;
extern const char *__doc_igl_per_face_normals;
extern const char *__doc_igl_per_face_normals_stable;
extern const char *__doc_igl_readOFF;
extern const char *__doc_igl_per_vertex_normals;
extern const char *__doc_igl_sortrows;
extern const char *__doc_igl_sort_angles;
extern const char *__doc_igl_sort_triangles;
extern const char *__doc_igl_sort_vectors_ccw;
extern const char *__doc_igl_sparse;
extern const char *__doc_igl_speye;
extern const char *__doc_igl_stdin_to_temp;
extern const char *__doc_igl_STR;
extern const char *__doc_igl_sum;
extern const char *__doc_igl_svd3x3;
extern const char *__doc_igl_svd3x3_avx;
extern const char *__doc_igl_svd3x3_sse;
extern const char *__doc_igl_Timer;
extern const char *__doc_igl_trackball;
extern const char *__doc_igl_transpose_blocks;
extern const char *__doc_igl_triangles_from_strip;
extern const char *__doc_igl_triangle_fan;
extern const char *__doc_igl_triangle_triangle_adjacency;
extern const char *__doc_igl_two_axis_valuator_fixed_up;
extern const char *__doc_igl_uniformly_sample_two_manifold;
extern const char *__doc_igl_unique;
extern const char *__doc_igl_unique_edge_map;
extern const char *__doc_igl_unique_simplices;
extern const char *__doc_igl_unproject;
extern const char *__doc_igl_upsample;
extern const char *__doc_igl_vector_area_matrix;
extern const char *__doc_igl_verbose;
extern const char *__doc_igl_vertex_triangle_adjacency;
extern const char *__doc_igl_Viewport;
extern const char *__doc_igl_volume;
extern const char *__doc_igl_WindingNumberAABB;
extern const char *__doc_igl_WindingNumberMethod;
extern const char *__doc_igl_WindingNumberTree;
extern const char *__doc_igl_winding_number;
extern const char *__doc_igl_writeDMAT;
extern const char *__doc_igl_writeMESH;
extern const char *__doc_igl_barycenter;
extern const char *__doc_igl_jet;
extern const char *__doc_igl_eigs;
extern const char *__doc_igl_per_corner_normals;
extern const char *__doc_igl_massmatrix;
extern const char *__doc_igl_colon;
extern const char *__doc_igl_rotate_vectors;
extern const char *__doc_igl_read_triangle_mesh;
extern const char *__doc_igl_gaussian_curvature;
extern const char *__doc_igl_avg_edge_length;
extern const char *__doc_igl_lscm;
extern const char *__doc_igl_find_cross_field_singularities;
extern const char *__doc_igl_parula;
extern const char *__doc_igl_setdiff;
extern const char *__doc_igl_comb_frame_field;
extern const char *__doc_igl_map_vertices_to_circle;
extern const char *__doc_igl_writeOBJ;
extern const char *__doc_igl_writeOFF;
extern const char *__doc_igl_writePLY;
extern const char *__doc_igl_writeSTL;
extern const char *__doc_igl_writeTGF;
extern const char *__doc_igl_writeWRL;
extern const char *__doc_igl_write_triangle_mesh;
extern const char *__doc_igl_ZERO;
extern const char *__doc_igl_anttweakbar_cocoa_key_to_anttweakbar_key;
extern const char *__doc_igl_anttweakbar_ReAntTweakBar;
extern const char *__doc_igl_bbw_bbw;
extern const char *__doc_igl_boolean_from_cork_mesh;
extern const char *__doc_igl_boolean_MeshBooleanType;
extern const char *__doc_igl_boolean_mesh_boolean;
extern const char *__doc_igl_boolean_mesh_boolean_cork;
extern const char *__doc_igl_boolean_to_cork_mesh;
extern const char *__doc_igl_cgal_complex_to_mesh;
extern const char *__doc_igl_cgal_intersect_other;
extern const char *__doc_igl_cgal_mesh_to_cgal_triangle_list;
extern const char *__doc_igl_cgal_mesh_to_polyhedron;
extern const char *__doc_igl_cgal_order_facets_around_edges;
extern const char *__doc_igl_cgal_outer_hull;
extern const char *__doc_igl_cgal_peel_outer_hull_layers;
extern const char *__doc_igl_cgal_point_mesh_squared_distance;
extern const char *__doc_igl_cgal_polyhedron_to_mesh;
extern const char *__doc_igl_cgal_RemeshSelfIntersectionsParam;
extern const char *__doc_igl_cgal_remesh_self_intersections;
extern const char *__doc_igl_cgal_SelfIntersectMesh;
extern const char *__doc_igl_cgal_signed_distance_isosurface;
extern const char *__doc_igl_comiso_frame_field;
extern const char *__doc_igl_comiso_miq;
extern const char *__doc_igl_comiso_nrosy;
extern const char *__doc_igl_embree_ambient_occlusion;
extern const char *__doc_igl_embree_bone_heat;
extern const char *__doc_igl_embree_bone_visible;
extern const char *__doc_igl_embree_EmbreeIntersector;
extern const char *__doc_igl_embree_Embree_convenience;
extern const char *__doc_igl_embree_Hit;
extern const char *__doc_igl_embree_line_mesh_intersection;
extern const char *__doc_igl_embree_reorient_facets_raycast;
extern const char *__doc_igl_embree_unproject_in_mesh;
extern const char *__doc_igl_embree_unproject_onto_mesh;
extern const char *__doc_igl_lim_lim;
extern const char *__doc_igl_matlab_matlabinterface;
extern const char *__doc_igl_matlab_MatlabWorkspace;
extern const char *__doc_igl_matlab_mexErrMsgTxt;
extern const char *__doc_igl_matlab_MexStream;
extern const char *__doc_igl_matlab_parse_rhs;
extern const char *__doc_igl_matlab_prepare_lhs;
extern const char *__doc_igl_mosek_mosek_guarded;
extern const char *__doc_igl_mosek_mosek_linprog;
extern const char *__doc_igl_mosek_mosek_quadprog;
extern const char *__doc_igl_opengl_compile_and_link_program;
extern const char *__doc_igl_opengl_compile_shader;
extern const char *__doc_igl_opengl_create_index_vbo;
extern const char *__doc_igl_opengl_create_mesh_vbo;
extern const char *__doc_igl_opengl_create_shader_program;
extern const char *__doc_igl_opengl_create_vector_vbo;
extern const char *__doc_igl_opengl_destroy_shader_program;
extern const char *__doc_igl_opengl_gl_type_size;
extern const char *__doc_igl_opengl_init_render_to_texture;
extern const char *__doc_igl_opengl_load_shader;
extern const char *__doc_igl_opengl_OpenGL_convenience;
extern const char *__doc_igl_opengl_print_program_info_log;
extern const char *__doc_igl_opengl_print_shader_info_log;
extern const char *__doc_igl_opengl_render_to_tga;
extern const char *__doc_igl_opengl_report_gl_error;
extern const char *__doc_igl_opengl_texture_from_tga;
extern const char *__doc_igl_opengl_tga;
extern const char *__doc_igl_opengl_uniform_type_to_string;
extern const char *__doc_igl_opengl2_draw_beach_ball;
extern const char *__doc_igl_opengl2_draw_floor;
extern const char *__doc_igl_opengl2_draw_mesh;
extern const char *__doc_igl_opengl2_draw_point;
extern const char *__doc_igl_opengl2_draw_rectangular_marquee;
extern const char *__doc_igl_opengl2_draw_skeleton_3d;
extern const char *__doc_igl_opengl2_draw_skeleton_vector_graphics;
extern const char *__doc_igl_opengl2_flare_textures;
extern const char *__doc_igl_opengl2_lens_flare;
extern const char *__doc_igl_opengl2_model_proj_viewport;
extern const char *__doc_igl_opengl2_MouseController;
extern const char *__doc_igl_opengl2_print_gl_get;
extern const char *__doc_igl_opengl2_project;
extern const char *__doc_igl_opengl2_right_axis;
extern const char *__doc_igl_opengl2_RotateWidget;
extern const char *__doc_igl_opengl2_shine_textures;
extern const char *__doc_igl_opengl2_sort_triangles;
extern const char *__doc_igl_opengl2_unproject;
extern const char *__doc_igl_opengl2_unproject_to_zero_plane;
extern const char *__doc_igl_opengl2_up_axis;
extern const char *__doc_igl_opengl2_view_axis;
extern const char *__doc_igl_png_render_to_png;
extern const char *__doc_igl_png_render_to_png_async;
extern const char *__doc_igl_png_texture_from_file;
extern const char *__doc_igl_png_texture_from_png;
extern const char *__doc_igl_tetgen_cdt;
extern const char *__doc_igl_tetgen_mesh_to_tetgenio;
extern const char *__doc_igl_tetgen_mesh_with_skeleton;
extern const char *__doc_igl_tetgen_read_into_tetgenio;
extern const char *__doc_igl_tetgen_tetgenio_to_tetmesh;
extern const char *__doc_igl_tetgen_tetrahedralize;
extern const char *__doc_igl_triangle_triangulate;
extern const char *__doc_igl_viewer_OpenGL_shader;
extern const char *__doc_igl_viewer_OpenGL_state;
extern const char *__doc_igl_viewer_TextRenderer;
extern const char *__doc_igl_viewer_TextRenderer_fonts;
extern const char *__doc_igl_viewer_Viewer;
extern const char *__doc_igl_viewer_ViewerCore;
extern const char *__doc_igl_viewer_ViewerData;
extern const char *__doc_igl_viewer_ViewerPlugin;
extern const char *__doc_igl_xml_ReAntTweakBarXMLSerialization;
extern const char *__doc_igl_xml_serialize_xml;
extern const char *__doc_igl_active_set;
extern const char *__doc_igl_boundary_facets;
extern const char *__doc_igl_compute_frame_field_bisectors;
extern const char *__doc_igl_readOBJ;
extern const char *__doc_igl_cut_mesh_from_singularities;
extern const char *__doc_igl_readDMAT;
extern const char *__doc_igl_doublearea;
extern const char *__doc_igl_doublearea_single;
extern const char *__doc_igl_doublearea_quad;
extern const char *__doc_igl_min_quad_with_fixed_precompute;
extern const char *__doc_igl_min_quad_with_fixed_solve;
extern const char *__doc_igl_min_quad_with_fixed;
extern const char *__doc_igl_unique;
extern const char *__doc_igl_unique_rows;
extern const char *__doc_igl_arap_precomputation;
extern const char *__doc_igl_arap_solve;
extern const char *__doc_igl_cross_field_missmatch;
extern const char *__doc_igl_grad;
extern const char *__doc_igl_slice_into;
extern const char *__doc_igl_n_polyvector;
extern const char *__doc_igl_harmonic;
extern const char *__doc_igl_boundary_loop;
extern const char *__doc_igl_comb_cross_field;
extern const char *__doc_igl_invert_diag;
extern const char *__doc_igl_copyleft_comiso_miq;
extern const char *__doc_igl_copyleft_comiso_nrosy;
+2 -2
View File
@@ -20,7 +20,7 @@ m.def("miq", []
std::vector<std::vector<int> > hard_features;
igl::copyleft::comiso::miq(V,F,PD1,PD2,UV,FUV,scale,stiffness,direct_round,iter,local_iter,DoRound, SingularityRound, round_vertices, hard_features);
}, __doc_igl_comiso_miq,
}, __doc_igl_copyleft_comiso_miq,
py::arg("V"), py::arg("F"), py::arg("PD1"), py::arg("PD2"), py::arg("UV"), py::arg("FUV"), py::arg("scale") = 30.0, py::arg("stiffness") = 5.0, py::arg("direct_round") = false, py::arg("iter") = 5, py::arg("local_iter") = 5, py::arg("DoRound") = true, py::arg("SingularityRound") = true
// , py::arg("round_vertices"), py::arg("hard_features")
);
@@ -51,7 +51,7 @@ m.def("miq", []
std::vector<std::vector<int> > hardFeatures;
igl::copyleft::comiso::miq(V,F,PD1_combed,PD2_combed,MMatch,Singular,Seams,UV,FUV,GradientSize,Stiffness,DirectRound,iter,localIter,DoRound, SingularityRound, roundVertices, hardFeatures);
}, __doc_igl_comiso_miq,
}, __doc_igl_copyleft_comiso_miq,
py::arg("V"), py::arg("F"), py::arg("PD1_combed"), py::arg("PD2_combed"),
py::arg("MMatch"), py::arg("Singular"), py::arg("Seams"),
py::arg("UV"), py::arg("FUV"), py::arg("GradientSize") = 30.0, py::arg("Stiffness") = 5.0, py::arg("DirectRound") = false, py::arg("iter") = 5, py::arg("localIter") = 5, py::arg("DoRound") = true, py::arg("SingularityRound") = true
+2 -2
View File
@@ -33,7 +33,7 @@ m.def("nrosy", []
igl::copyleft::comiso::nrosy(V,F,bt,bc,b_softt,w_softt,bc_soft,N,soft,R,St);
S = St;
}, __doc_igl_comiso_nrosy,
}, __doc_igl_copyleft_comiso_nrosy,
py::arg("V"), py::arg("F"), py::arg("b"), py::arg("bc"), py::arg("b_soft"), py::arg("w_soft"), py::arg("bc_soft"), py::arg("N"), py::arg("soft"), py::arg("R"), py::arg("S"));
m.def("nrosy", []
@@ -56,5 +56,5 @@ m.def("nrosy", []
Eigen::VectorXd St;
igl::copyleft::comiso::nrosy(V,F,bt,bc,N,R,St);
S = St;
}, __doc_igl_comiso_nrosy,
}, __doc_igl_copyleft_comiso_nrosy,
py::arg("V"), py::arg("F"), py::arg("b"), py::arg("bc"), py::arg("N"), py::arg("R"), py::arg("S"));
+2 -2
View File
@@ -46,7 +46,7 @@ m.def("arap_precomputation", []
bt = b;
return igl::arap_precomputation(V,F,dim,bt,data);
}, __doc_igl_arap,
}, __doc_igl_arap_precomputation,
py::arg("V"), py::arg("F"), py::arg("dim"), py::arg("b"), py::arg("data"));
m.def("arap_solve", []
@@ -57,5 +57,5 @@ m.def("arap_solve", []
)
{
return igl::arap_solve(bc,data,U);
}, __doc_igl_arap,
}, __doc_igl_arap_solve,
py::arg("bc"), py::arg("data"), py::arg("U"));
+2 -2
View File
@@ -29,7 +29,7 @@ m.def("doublearea_single", []
)
{
return igl::doublearea_single(A,B,C);
}, __doc_igl_doublearea,
}, __doc_igl_doublearea_single,
py::arg("A"), py::arg("B"), py::arg("C"));
m.def("doublearea", []
@@ -50,5 +50,5 @@ m.def("doublearea_quad", []
)
{
return igl::doublearea_quad(V,F,dblA);
}, __doc_igl_doublearea,
}, __doc_igl_doublearea_quad,
py::arg("V"), py::arg("F"), py::arg("dblA"));
+126
View File
@@ -0,0 +1,126 @@
#!/usr/bin/env python3
#
# Syntax: generate_docstrings.py <path_to_c++_header_files> <path_to_python_files>
#
# Extract documentation from C++ header files to use it in libiglPython bindings
#
import os, sys, glob
from joblib import Parallel, delayed
from multiprocessing import cpu_count
from mako.template import Template
from parser import parse
# http://stackoverflow.com/questions/3207219/how-to-list-all-files-of-a-directory-in-python
def get_filepaths(directory):
"""
This function will generate the file names in a directory
tree by walking the tree either top-down or bottom-up. For each
directory in the tree rooted at directory top (including top itself),
it yields a 3-tuple (dirpath, dirnames, filenames).
"""
file_paths = [] # List which will store all of the full filepaths.
# Walk the tree.
for root, directories, files in os.walk(directory):
for filename in files:
# Join the two strings in order to form the full filepath.
filepath = os.path.join(root, filename)
file_paths.append(filepath) # Add it to the list.
return file_paths # Self-explanatory.
def get_name_from_path(path, basepath, prefix, postfix):
f_clean = path[len(basepath):]
f_clean = f_clean.replace(basepath, "")
f_clean = f_clean.replace(postfix, "")
f_clean = f_clean.replace(prefix, "")
f_clean = f_clean.replace("/", "_")
f_clean = f_clean.replace("\\", "_")
f_clean = f_clean.replace(" ", "_")
f_clean = f_clean.replace(".", "_")
return f_clean
if __name__ == '__main__':
if len(sys.argv) != 3:
print('Syntax: %s <path_to_c++_header_files> <path_to_python_files>' % sys.argv[0])
exit(-1)
# List all files in the given folder and subfolders
cpp_base_path = sys.argv[1]
py_base_path = sys.argv[2]
cpp_file_paths = get_filepaths(cpp_base_path)
py_file_paths = get_filepaths(py_base_path)
# Add all the .h filepaths to a dict
mapping = {}
for f in cpp_file_paths:
if f.endswith(".h"):
name = get_name_from_path(f, cpp_base_path, "", ".h")
mapping[name] = f
# Add all python binding files to a list
implemented_names = []
for f in py_file_paths:
if f.endswith(".cpp"):
name = get_name_from_path(f, py_base_path, "py_", ".cpp")
implemented_names.append(name)
# Create a list of cpp header files for which a python binding file exists
files_to_parse = []
for n in implemented_names:
if n not in mapping:
print("No cpp header file for python function %s found." % n)
continue
files_to_parse.append(mapping[n])
# print(mapping[n])
# Parse c++ header files
job_count = cpu_count()
dicts = Parallel(n_jobs=job_count)(delayed(parse)(path) for path in files_to_parse)
hpplines = []
cpplines = []
for idx, n in enumerate(implemented_names):
dict = dicts[idx]
contained_elements = sum(map(lambda x: len(x), dict.values()))
# Check for files that don't contain functions/enums/classes
if contained_elements == 0:
print("Function %s contains no parseable content in cpp header. Something might be wrong." % n)
continue
else:
names = []
namespaces = "_".join(dict["namespaces"]) # Assumption that all entities lie in deepest namespace
for f in dict["functions"]:
h_string = "extern const char *__doc_" + namespaces + "_" + f.name + ";\n"
docu_string = "See " + f.name + " for the documentation."
if f.documentation != "":
docu_string = f.documentation
cpp_string = "const char *__doc_" + namespaces + "_" + f.name + " = R\"igl_Qu8mg5v7(" + docu_string + ")igl_Qu8mg5v7\";\n"
if f.name not in names: # Prevent multiple additions of declarations, TODO: Possible fix is to merge comments and add them to all functions
hpplines.append(h_string)
cpplines.append(cpp_string)
names.append(f.name)
# Change directory to become independent of execution directory
path = os.path.dirname(__file__)
if path != "":
os.chdir(path)
# Update the two files py_doc.h and py_doc.cpp
with open('../py_doc.h', 'w') as fh:
fh.writelines(hpplines)
with open('../py_doc.cpp', 'w') as fc:
fc.writelines(cpplines)
# Write python_shared_cpp file
tpl = Template(filename='python_shared.mako')
rendered = tpl.render(functions=implemented_names)
with open("../python_shared.cpp", 'w') as fs:
fs.write(rendered)
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env python3
#
# Syntax: mkdoc.py <path_of_header_files>
#
# Extract documentation from C++ header files to use it in libiglPython bindings
#
import os, sys, glob
#http://stackoverflow.com/questions/3207219/how-to-list-all-files-of-a-directory-in-python
def get_filepaths(directory):
"""
This function will generate the file names in a directory
tree by walking the tree either top-down or bottom-up. For each
directory in the tree rooted at directory top (including top itself),
it yields a 3-tuple (dirpath, dirnames, filenames).
"""
file_paths = [] # List which will store all of the full filepaths.
# Walk the tree.
for root, directories, files in os.walk(directory):
for filename in files:
# Join the two strings in order to form the full filepath.
filepath = os.path.join(root, filename)
file_paths.append(filepath) # Add it to the list.
return file_paths # Self-explanatory.
if __name__ == '__main__':
if len(sys.argv) != 2:
print('Syntax: %s <path_of_header_files>' % sys.argv[0])
exit(-1)
# Open two files, py_doc.h and py_doc.cpp
fh = open('py_doc.h', 'w')
fc = open('py_doc.cpp', 'w')
# List all files in the given folder and subfolders
base_path = sys.argv[1]
full_file_paths = get_filepaths(base_path)
# Add all the .h files
for f in full_file_paths:
if f.endswith(".h"):
f_clean = f[len(base_path):]
f_clean = f_clean.replace(base_path, "")
f_clean = f_clean.replace(".h", "")
f_clean = f_clean.replace("/", "_")
f_clean = f_clean.replace("\\", "_")
f_clean = f_clean.replace(" ", "_")
f_clean = f_clean.replace(".", "_")
#tmp = open(f, 'r', encoding="utf8")
tmp_string = f.replace("../include/", "libigl/") # " " # tmp.read()
tmp_string = "See " + tmp_string + " for the documentation."
#tmp.close()
h_string = "extern const char *__doc_" + f_clean + ";\n"
cpp_string = "const char *__doc_" + f_clean + " = R\"igl_Qu8mg5v7(" + tmp_string + ")igl_Qu8mg5v7\";\n"
fh.write(h_string)
fc.write(cpp_string)
# Close files
fh.close()
fc.close()
+123
View File
@@ -0,0 +1,123 @@
import sys
import os
from threading import Thread
import clang.cindex
import itertools
from mako.template import Template
def get_annotations(node):
return [c.displayname for c in node.get_children()
if c.kind == clang.cindex.CursorKind.ANNOTATE_ATTR]
class Function(object):
def __init__(self, cursor):
self.name = cursor.spelling
self.annotations = get_annotations(cursor)
self.access = cursor.access_specifier
# template_pars = [c.extent for c in cursor.get_children() if c.kind == clang.cindex.CursorKind.TEMPLATE_TYPE_PARAMETER]
# parameter_dec = [c for c in cursor.get_children() if c.kind == clang.cindex.CursorKind.PARM_DECL]
# print(parameter_dec, template_pars)
# print(cursor.get_num_template_arguments(), cursor.get_template_argument_type(0), cursor.get_template_argument_value(0), template_pars, parameter_dec)
self.parameters = []
self.parnames = []
self.documentation = cursor.raw_comment
class Enum(object):
def __init__(self, cursor):
self.name = cursor.spelling
self.annotations = get_annotations(cursor)
self.access = cursor.access_specifier
# template_pars = [c.extent for c in cursor.get_children() if c.kind == clang.cindex.CursorKind.TEMPLATE_TYPE_PARAMETER]
# parameter_dec = [c for c in cursor.get_children() if c.kind == clang.cindex.CursorKind.PARM_DECL]
# print(parameter_dec, template_pars)
# print(cursor.get_num_template_arguments(), cursor.get_template_argument_type(0), cursor.get_template_argument_value(0), template_pars, parameter_dec)
self.parameters = []
self.parnames = []
self.documentation = cursor.raw_comment
# class Class(object):
# def __init__(self, cursor):
# self.name = cursor.spelling
# self.functions = []
# self.annotations = get_annotations(cursor)
# for c in cursor.get_children():
# if (c.kind == clang.cindex.CursorKind.CXX_METHOD and
# c.access_specifier == clang.cindex.AccessSpecifier.PUBLIC):
# f = Function(c)
# self.functions.append(f)
def find_namespace_node(c):
if (c.kind == clang.cindex.CursorKind.NAMESPACE and c.spelling == "igl"):
return c
else:
for child_node in c.get_children():
return find_namespace_node(child_node)
def traverse(c, path, objects):
if c.location.file and not c.location.file.name.endswith(path):
return
# print(c.kind, c.spelling)
if c.kind == clang.cindex.CursorKind.TRANSLATION_UNIT or c.kind == clang.cindex.CursorKind.UNEXPOSED_DECL:
# Ignore other cursor kinds
pass
elif c.kind == clang.cindex.CursorKind.NAMESPACE:
objects["namespaces"].append(c.spelling)
# print("Namespace", c.spelling, c.get_children())
pass
elif c.kind == clang.cindex.CursorKind.FUNCTION_TEMPLATE:
# print("Function Template", c.spelling, c.raw_comment)
objects["functions"].append(Function(c))
return
elif c.kind == clang.cindex.CursorKind.FUNCTION_DECL:
# print("FUNCTION_DECL", c.spelling, c.raw_comment)
objects["functions"].append(Function(c))
return
elif c.kind == clang.cindex.CursorKind.ENUM_DECL:
# print("ENUM_DECL", c.spelling, c.raw_comment)
objects["enums"].append(Enum(c))
return
else:
# print("Unknown", c.kind, c.spelling)
pass
for child_node in c.get_children():
traverse(child_node, path, objects)
def parse(path):
index = clang.cindex.Index.create()
tu = index.parse(path, ['-x', 'c++', '-std=c++11', '-fparse-all-comments', '-DIGL_STATIC_LIBRARY'])
# Clang can't parse files with missing definitions, add static library definition
objects = {"functions": [], "enums": [], "namespaces": [], "classes": []}
traverse(tu.cursor, path, objects)
# tpl = Template(filename='bind.mako')
# rendered = tpl.render(functions=functions)
# OUTPUT_DIR = 'generated'
# if not os.path.isdir(OUTPUT_DIR): os.mkdir(OUTPUT_DIR)
# with open("generated/{}.bind.cc".format(sys.argv[1]), "w") as f:
# f.write(rendered)
return objects
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: python3 parser.py <headerfile_path>")
exit(-1)
parse(sys.argv[1])
+46
View File
@@ -0,0 +1,46 @@
#include "python_shared.h"
#include <sstream>
#include <string>
#include <fstream>
extern void python_export_vector(py::module &);
extern void python_export_igl(py::module &);
#ifdef PY_VIEWER
extern void python_export_igl_viewer(py::module &);
#endif
#ifdef PY_COMISO
extern void python_export_igl_comiso(py::module &);
#endif
PYBIND11_PLUGIN(pyigl) {
py::module m("pyigl", R"pyigldoc(
Python wrappers for libigl
--------------------------
.. currentmodule:: pyigl
.. autosummary::
:toctree: _generate
% for f in functions:
${f}
% endfor
)pyigldoc");
python_export_vector(m);
python_export_igl(m);
#ifdef PY_VIEWER
python_export_igl_viewer(m);
#endif
#ifdef PY_COMISO
python_export_igl_comiso(m);
#endif
return m.ptr();
}