From 3a5ba02354d94553a41c7a836d28cc53ebe81667 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 19 Oct 2001 16:03:49 +0000 Subject: [PATCH] The hopefully final batch of necessary header files --- config.h | 11 + configure.ac | 2 + deform.h | 145 ++++++++++++++ deform_prototypes.h | 267 +++++++++++++++++++++++++ interval.h | 466 +++++++++++++++++++++++++++++++++++++++++++ sp_geom_prototypes.h | 86 ++++++++ 6 files changed, 977 insertions(+) create mode 100644 config.h create mode 100644 deform.h create mode 100644 deform_prototypes.h create mode 100644 interval.h create mode 100644 sp_geom_prototypes.h diff --git a/config.h b/config.h new file mode 100644 index 0000000..c6942d1 --- /dev/null +++ b/config.h @@ -0,0 +1,11 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.ac by autoheader. */ + +/* Define if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Name of package */ +#define PACKAGE "conglomerate" + +/* Version number of package */ +#define VERSION "1.0" diff --git a/configure.ac b/configure.ac index 8ba1693..613c060 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,8 @@ AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CXX +AM_PROG_LIBTOOL + mni_REQUIRE_BICPL # check for special header files needed diff --git a/deform.h b/deform.h new file mode 100644 index 0000000..c0d9704 --- /dev/null +++ b/deform.h @@ -0,0 +1,145 @@ +#ifndef DEF_DEFORM +#define DEF_DEFORM + +#include + +typedef enum { TOWARDS_LOWER, TOWARDS_HIGHER, ANY_DIRECTION } + Normal_directions; + +typedef struct +{ + Real min_isovalue; + Real max_isovalue; + Real gradient_threshold; + Real min_dot_product; + Real max_dot_product; + Normal_directions normal_direction; + Real tolerance; +} boundary_definition_struct; + +typedef enum { VOLUME_DATA } Deform_data_types; + +typedef struct +{ + Deform_data_types type; + Volume volume; + Volume label_volume; +} deform_data_struct; + +typedef enum { FLAT_MODEL, AVERAGE_MODEL, + PARAMETRIC_MODEL, GENERAL_MODEL } + Deformation_model_types; + +typedef struct +{ + int up_to_n_points; + + Deformation_model_types model_type; + Real model_weight; + object_struct *model_object; + + int n_model_points; + Point *model_centroids; + Vector *model_normals; + Point *model_points; + + Real min_curvature_offset; + Real max_curvature_offset; +} deform_model_struct; + +typedef struct +{ + int n_models; + deform_model_struct *models; + BOOLEAN position_constrained; + Real max_position_offset; + Point *original_positions; +} deformation_model_struct; + +typedef struct +{ + deform_data_struct deform_data; + deformation_model_struct deformation_model; + Real fractional_step; + Real max_step; + Real max_search_distance; + int degrees_continuity; + boundary_definition_struct boundary_definition; + int max_iterations; + Real stop_threshold; + + int n_movements_alloced; + float *prev_movements; + Real movement_threshold; +} deform_struct; + +#define MAX_IN_VOXEL_COEF_LOOKUP 10000 + +typedef struct voxel_lin_coef_struct +{ + int hash_key; + Real coefs[8]; + struct voxel_lin_coef_struct *prev; + struct voxel_lin_coef_struct *next; +} +voxel_lin_coef_struct; + +typedef struct +{ + hash_table_struct hash; + int n_in_hash; + voxel_lin_coef_struct *head; + voxel_lin_coef_struct *tail; +} voxel_coef_struct; + +#define N_DEFORM_HISTOGRAM 7 + +typedef struct +{ + Real average; + Real maximum; + int n_below[N_DEFORM_HISTOGRAM]; +} deform_stats; + +typedef struct +{ + int axis; + Point *save_points; + Real *curvature_factors; + Point *equilibrium_points; + Point *new_equilibrium_points; + Point *boundary_points; + Point *new_boundary_points; + Real temperature; + Real temperature_factor; + int temperature_step; + int min_n_to_move; + int max_n_to_move; + Real max_translation; + Real max_angle_rotation; + Real max_scale_offset; + int stop_criteria; + int try; + int max_tries; + int max_successes; + int n_successes; + int n_pos_successes; + int n_no_moves; + Real min_delta_energy; + Real max_delta_energy; + Real energy; +} anneal_struct; + +#ifndef public +#define public extern +#define public_was_defined_here +#endif + +#include + +#ifdef public_was_defined_here +#undef public +#undef public_was_defined_here +#endif + +#endif diff --git a/deform_prototypes.h b/deform_prototypes.h new file mode 100644 index 0000000..2e7e784 --- /dev/null +++ b/deform_prototypes.h @@ -0,0 +1,267 @@ +#ifndef DEF_deform_prototypes +#define DEF_deform_prototypes + +public void deform_lines( + lines_struct *lines, + deform_struct *deform_parms ); + +public void deform_lines_one_iteration( + lines_struct *lines, + deform_struct *deform_parms, + int iteration ); + +public void get_line_equilibrium_point( + lines_struct *lines, + int axis, + int point_index, + int neighbours[], + Real curvature_factors[], + Real max_search_distance, + int degrees_continuity, + Volume volume, + Volume label_volume, + boundary_definition_struct *boundary_def, + deformation_model_struct *deformation_model, + Point *equilibrium_point, + Point *boundary_point ); + +public int find_axial_plane( + lines_struct *lines ); + +public void deform_polygons( + polygons_struct *polygons, + deform_struct *deform_parms ); + +public void deform_polygons_one_iteration( + polygons_struct *polygons, + deform_struct *deform_parms, + int iteration ); + +public BOOLEAN find_boundary_in_direction( + Volume volume, + Volume label_volume, + voxel_coef_struct *lookup, + bitlist_3d_struct *done_bits, + bitlist_3d_struct *surface_bits, + Real model_dist, + Point *ray_origin, + Vector *unit_pos_dir, + Vector *unit_neg_dir, + Real max_outwards_search_distance, + Real max_inwards_search_distance, + int degrees_continuity, + boundary_definition_struct *boundary_def, + Real *boundary_distance ); + +public int find_voxel_line_polynomial( + Real coefs[], + int degrees_continuity, + int x, + int y, + int z, + Real line_origin[], + Real line_direction[], + Real line_poly[] ); + +public int find_voxel_line_value_intersection( + Real coefs[], + int degrees_continuity, + int x, + int y, + int z, + Real line_origin[], + Real line_direction[], + Real t_min, + Real t_max, + Real isovalue, + Real distances[3] ); + +public void initialize_deformation_model( + deformation_model_struct *model ); + +public void print_deformation_model( + deformation_model_struct *deformation_model ); + +public Status add_deformation_model( + deformation_model_struct *deformation_model, + int up_to_n_points, + Real model_weight, + char model_filename[], + Real min_curvature_offset, + Real max_curvature_offset ); + +public void delete_deformation_model( + deformation_model_struct *model ); + +public Status input_original_positions( + deformation_model_struct *deform_model, + char position_filename[], + Real max_position_offset, + int n_deforming_points ); + +public BOOLEAN check_correct_deformation_polygons( + polygons_struct *polygons, + deformation_model_struct *model ); + +public BOOLEAN check_correct_deformation_lines( + lines_struct *lines, + deformation_model_struct *model ); + +public deform_model_struct *find_relevent_model( + deformation_model_struct *model, + int point_index ); + +public void get_model_shape_point( + Point *origin, + Vector *pos_model_dir, + Vector *neg_model_dir, + Real dist, + Point *point ); + +public void compute_equilibrium_point( + int point_index, + BOOLEAN boundary_exists, + Real boundary_dist, + Real base_length, + Real model_dist, + Vector *pos_model_dir, + Vector *neg_model_dir, + Point *centroid, + deformation_model_struct *deformation_model, + Point *equilibrium_point ); + +public void compute_model_dirs( + Point *centroid, + Vector *normal, + Real base_length, + Point *model_point, + Real *model_dist, + Point *search_origin, + Vector *pos_model_dir, + Vector *neg_model_dir ); + +public void get_model_point( + deformation_model_struct *deformation_model, + Point points[], + int point_index, + int n_neighbours, + int neighbours[], + Real curvatures[], + Point *centroid, + Vector *normal, + Real base_length, + Point *model_point ); + +public void get_neighbours_of_line_vertex( + lines_struct *lines, + int vertex_index, + int neighbours[2] ); + +public BOOLEAN deformation_model_includes_average( + deformation_model_struct *model ); + +public Real compute_line_curvature( + lines_struct *lines, + int axis, + int point_index, + int prev_point_index, + int next_point_index ); + +public Real deform_point( + int point_index, + Point points[], + Point *equilibrium_point, + Real fractional_step, + Real max_step, + BOOLEAN position_constrained, + Real max_position_offset, + Point original_positions[], + Point *new_point ); + +public void compute_line_centroid_and_normal( + lines_struct *lines, + int axis, + int prev_point_index, + int next_point_index, + Point *centroid, + Vector *normal, + Real *base_length ); + +public int get_subsampled_neighbours_of_point( + deformation_model_struct *deformation_model, + polygons_struct *polygons, + int poly, + int vertex_index, + int neighbours[], + int max_neighbours, + BOOLEAN *interior_flag ); + +public BOOLEAN is_point_inside_surface( + Volume volume, + Volume label_volume, + int continuity, + Real voxel[], + Vector *direction, + boundary_definition_struct *boundary_def ); + +public void get_centre_of_cube( + Point *cube, + int sizes[3], + Point *centre ); + +public BOOLEAN contains_value( + Real values[2][2][2], + int sizes[3] ); + +public BOOLEAN cube_is_small_enough( + Point cube[2], + int sizes[3], + Real min_cube_size ); + +public void initialize_deform_stats( + deform_stats *stats ); + +public void record_error_in_deform_stats( + deform_stats *stats, + Real error ); + +public void print_deform_stats( + deform_stats *stats, + int n_points ); + +public BOOLEAN get_max_point_cube_distance( + Point cube[2], + int sizes[3], + Point *point, + Real *distance ); + +public void initialize_deformation_parameters( + deform_struct *deform ); + +public void delete_deformation_parameters( + deform_struct *deform ); + +public void set_boundary_definition( + boundary_definition_struct *boundary_def, + Real min_value, + Real max_value, + Real grad_threshold, + Real angle, + char direction, + Real tolerance ); + +public void initialize_lookup_volume_coeficients( + voxel_coef_struct *lookup ); + +public void lookup_volume_coeficients( + voxel_coef_struct *lookup, + Volume volume, + int degrees_continuity, + int x, + int y, + int z, + Real c[] ); + +public void delete_lookup_volume_coeficients( + voxel_coef_struct *lookup ); +#endif diff --git a/interval.h b/interval.h new file mode 100644 index 0000000..e4d6317 --- /dev/null +++ b/interval.h @@ -0,0 +1,466 @@ +#ifndef DEF_INTERVAL +#define DEF_INTERVAL + +#include + +#ifdef __sgi + +/* these five functions are incorrectly prototyped in sys/fpu.h, so + we correct them here, using defines */ + +#define get_fpc_csr (*get_fpc_csr_ignore) +#define set_fpc_csr (*set_fpc_csr_ignore) +#define get_fpc_irr (*get_fpc_irr_ignore) +#define set_fpc_led (*set_fpc_led_ignore) +#define get_fpc_eir (*get_fpc_eir_ignore) + +#include + +extern int swapRM(int x); + +#undef get_fpc_csr +#undef set_fpc_csr +#undef get_fpc_irr +#undef set_fpc_led +#undef get_fpc_eir + +extern unsigned long get_fpc_csr( void ); +extern unsigned long set_fpc_csr( void ); +extern unsigned long get_fpc_irr( void ); +extern void set_fpc_led( void ); +extern unsigned long get_fpc_eir( void ); + +#define SAVE_ROUNDING int _save +#define RESTORE_ROUNDING (void) swapRM( _save ) +#define ROUND_DOWN swapRM( FUNC_FLOOR ) +#define ROUND_UP swapRM( FUNC_CEIL ) + +#else + +#define SAVE_ROUNDING int _save +#define RESTORE_ROUNDING +#define ROUND_DOWN +#define ROUND_UP + +#endif + +typedef struct +{ + Real low, high; +} Interval; + +#define SET_INTERVAL( i, l, h ) \ + { SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + (i).low = (l); \ + (void) ROUND_UP; \ + (i).high = (h); \ + RESTORE_ROUNDING; \ + } + +#define SET_INTERVAL_MIN( i, m ) \ + { SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + (i).low = (m); \ + RESTORE_ROUNDING; \ + } + +#define SET_INTERVAL_MAX( i, m ) \ + { SAVE_ROUNDING; \ + _save = ROUND_UP; \ + (i).high = (m); \ + RESTORE_ROUNDING; \ + } + +#define INTERVAL_SIZE( i ) ( (i).high - (i).low ) + +#define INTERVAL_MIDPOINT( i ) ( ( (i).low + (i).high ) / 2.0 ) + +#define INTERVAL_MIN( i ) ( (i).low ) + +#define INTERVAL_MAX( i ) ( (i).high ) + +#define INTERVAL_CONTAINS( i, value ) \ + ( (i).low <= (value) && (value) <= (i).high ) + +#define INTERVALS_EQUAL( i1, i2 ) \ + ( (i1).low == (i2).low && (i1).high == (i2).high ) + +#define ADD_INTERVALS( result, i1, i2 ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + (result).low = (i1).low + (i2).low; \ + (void) ROUND_UP; \ + (result).high = (i1).high + (i2).high; \ + RESTORE_ROUNDING; \ + } + +#define ADD_INTERVAL_REAL( result, i, r ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + (result).low = (i).low + (r); \ + (void) ROUND_UP; \ + (result).high = (i).high + (r); \ + RESTORE_ROUNDING; \ + } + +#define SUBTRACT_INTERVAL_REAL( result, i, r ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + (result).low = (i).low - (r); \ + (void) ROUND_UP; \ + (result).high = (i).high - (r); \ + RESTORE_ROUNDING; \ + } + +#define MULT_INTERVAL_REAL( result, i, r ) \ + { \ + Real al, bl, ah, bh; \ + SAVE_ROUNDING; \ + \ + _save = ROUND_DOWN; \ + al = (i).low * (r); \ + bl = (i).high * (r); \ + \ + (void) ROUND_UP; \ + ah = (i).low * (r); \ + bh = (i).high * (r); \ + RESTORE_ROUNDING; \ + \ + (result).low = MIN( al, bl ); \ + (result).high = MAX( ah, bh ); \ + } \ + +#define SUBTRACT_INTERVALS( result, i1, i2 ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + (result).low = (i1).low - (i2).high; \ + (void) ROUND_UP; \ + (result).high = (i1).high - (i2).low; \ + RESTORE_ROUNDING; \ + } + +#define MIN4( min, a, b, c, d ) \ + { \ + Real min_ab, min_cd; \ + \ + min_ab = MIN( a, b ); \ + min_cd = MIN( c, d ); \ + (min) = MIN( min_ab, min_cd ); \ + } + +#define MAX4( max, a, b, c, d ) \ + { \ + Real max_ab, max_cd; \ + \ + max_ab = MAX( a, b ); \ + max_cd = MAX( c, d ); \ + (max) = MAX( max_ab, max_cd ); \ + } + +#define MULT_INTERVALS( result, i1, i2 ) \ + { \ + Real acl, adl, bcl, bdl; \ + Real ach, adh, bch, bdh; \ + SAVE_ROUNDING; \ + \ + _save = ROUND_DOWN; \ + acl = (i1).low * (i2).low; \ + adl = (i1).low * (i2).high; \ + bcl = (i1).high * (i2).low; \ + bdl = (i1).high * (i2).high; \ + \ + (void) ROUND_UP; \ + ach = (i1).low * (i2).low; \ + adh= (i1).low * (i2).high; \ + bch= (i1).high * (i2).low; \ + bdh= (i1).high * (i2).high; \ + RESTORE_ROUNDING; \ + \ + MIN4( (result).low, acl, adl, bcl, bdl ); \ + MAX4( (result).high, ach, adh, bch, bdh ); \ + } \ + +#define DIVIDE_INTERVAL_REAL( result, i, r ) \ + { \ + Real al, bl; \ + Real ah, bh; \ + \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + \ + al = (i).low / (r); \ + bl = (i).high / (r); \ + \ + (void) ROUND_UP; \ + ah = (i).low / (r); \ + bh = (i).high / (r); \ + RESTORE_ROUNDING; \ + \ + (result).low = MIN( al, bl ); \ + (result).high = MAX( ah, bh ); \ + } + +#define DIVIDE_INTERVALS( result, i1, i2 ) \ + { \ + Real acl, adl, bcl, bdl; \ + Real ach, adh, bch, bdh; \ + if( (i2).low >= 0.0 || (i2).high <= 0.0 ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + \ + acl = (i1).low / (i2).low; \ + adl = (i1).low / (i2).high; \ + bcl = (i1).high / (i2).low; \ + bdl = (i1).high / (i2).high; \ + \ + (void) ROUND_UP; \ + ach = (i1).low / (i2).low; \ + adh = (i1).low / (i2).high; \ + bch = (i1).high / (i2).low; \ + bdh = (i1).high / (i2).high; \ + RESTORE_ROUNDING; \ + \ + MIN4( (result).low, acl, adl, bcl, bdl ); \ + MAX4( (result).high, ach, adh, bch, bdh ); \ + } \ + else \ + { \ + (result).low = -1.0 / 0.0; \ + (result).high = 1.0 / 0.0; \ + } \ + } + +#define SQUARE_INTERVAL( result, i ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + if( (i).low >= 0.0 ) \ + { \ + (result).low = (i).low * (i).low; \ + (void) ROUND_UP; \ + (result).high = (i).high * (i).high; \ + } \ + else if( (i).high <= 0.0 ) \ + { \ + (result).low = (i).high * (i).high; \ + (void) ROUND_UP; \ + (result).high = (i).low * (i).low; \ + } \ + else \ + { \ + (result).low = 0.0; \ + (void) ROUND_UP; \ + if( -(i).low > (i).high ) \ + (result).high = (i).low * (i).low; \ + else \ + (result).high = (i).high * (i).high; \ + } \ + RESTORE_ROUNDING; \ + } + +#define SQUARE_ROOT_INTERVAL( result, i ) \ + { \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + if( (i).low >= 0.0 ) \ + { \ + (result).low = sqrt( (i).low ); \ + (void) ROUND_UP; \ + (result).high = sqrt( (i).high ); \ + } \ + else if( (i).high <= 0.0 ) \ + { \ + (result).low = 0.0; \ + (void) ROUND_UP; \ + (result).high = 0.0; \ + } \ + else \ + { \ + (result).low = 0.0; \ + (void) ROUND_UP; \ + (result).high = sqrt( (i).high ); \ + } \ + RESTORE_ROUNDING; \ + } + +#define COS_INTERVAL( result, i ) \ + { \ + int int_a_over_pi; \ + Real a_over_pi, b_over_pi, cos_low, cos_high; \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + \ + a_over_pi = (i).low / PI; \ + b_over_pi = (i).high / PI; \ + int_a_over_pi = CEILING( a_over_pi ); \ + \ + if( int_a_over_pi + 1.0 <= b_over_pi ) \ + { \ + (result).low = -1.0; \ + (result).high = 1.0; \ + } \ + else \ + { \ + cos_low = cos( (i).low ); \ + cos_high = cos( (i).high ); \ + \ + if( int_a_over_pi <= b_over_pi ) \ + { \ + if( int_a_over_pi % 2 == 1 ) \ + { \ + (result).low = -1.0; \ + (result).high = MAX( cos_low, cos_high ); \ + } \ + else \ + { \ + (result).low = MIN( cos_low, cos_high ); \ + (result).high = 1.0; \ + } \ + } \ + else if( cos_low <= cos_high ) \ + { \ + (result).low = cos_low; \ + (result).high = cos_high; \ + } \ + else \ + { \ + (result).low = cos_high; \ + (result).high = cos_low; \ + } \ + } \ + RESTORE_ROUNDING; \ + } + +#define SIN_INTERVAL( result, i ) \ + { \ + int int_a_over_pi; \ + Real a_over_pi, b_over_pi, sin_low, sin_high; \ + \ + SAVE_ROUNDING; \ + _save = ROUND_DOWN; \ + a_over_pi = (i).low / PI - 0.5; \ + b_over_pi = (i).high / PI - 0.5; \ + int_a_over_pi = CEILING( a_over_pi ); \ + \ + if( int_a_over_pi + 1.0 <= b_over_pi ) \ + { \ + (result).low = -1.0; \ + (result).high = 1.0; \ + } \ + else \ + { \ + sin_low = sin( (i).low ); \ + sin_high = sin( (i).high ); \ + \ + if( int_a_over_pi <= b_over_pi ) \ + { \ + if( int_a_over_pi % 2 == 1 ) \ + { \ + (result).low = -1.0; \ + (result).high = MAX( sin_low, sin_high ); \ + } \ + else \ + { \ + (result).low = MIN( sin_low, sin_high ); \ + (result).high = 1.0; \ + } \ + } \ + else if( sin_low <= sin_high ) \ + { \ + (result).low = sin_low; \ + (result).high = sin_high; \ + } \ + else \ + { \ + (result).low = sin_high; \ + (result).high = sin_low; \ + } \ + } \ + RESTORE_ROUNDING; \ + } + +#define ABS_INTERVAL( result, i ) \ + { \ + if( (i).low >= 0.0 ) \ + { \ + (result) = (i); \ + } \ + else if( (i).high <= 0.0 ) \ + { \ + (result).low = -(i).high; \ + (result).high = -(i).low; \ + } \ + else \ + { \ + (result).low = 0.0; \ + if( (i).high > -(i).low ) \ + (result).high = (i).high; \ + else \ + (result).high = -(i).low; \ + } \ + } + +#define MIN_INTERVALS( result, i1, i2 ) \ + { \ + (result).low = MIN( (i1).low, (i2).low ); \ + (result).high = MIN( (i1).high, (i2).high ); \ + } + +#define MAX_INTERVALS( result, i1, i2 ) \ + { \ + (result).low = MAX( (i1).low, (i2).low ); \ + (result).high = MAX( (i1).high, (i2).high ); \ + } + +#define INTERVAL_SIGN( result, i ) \ + { \ + if( (i).high < 0.0 ) \ + { \ + (result).low = -1.0; \ + (result).high = -1.0; \ + } \ + else if( (i).low > 0.0 ) \ + { \ + (result).low = 1.0; \ + (result).high = 1.0; \ + } \ + else if( (i).low < 0.0 && (i).high > 0.0 ) \ + { \ + (result).low = -1.0; \ + (result).high = 1.0; \ + } \ + else if( (i).high <= 0.0 && (i).high == 0.0 ) \ + { \ + (result).low = -1.0; \ + (result).high = 0.0; \ + } \ + else if( (i).high == 0.0 && (i).low == 0.0 ) \ + { \ + (result).low = 0.0; \ + (result).high = 0.0; \ + } \ + else if( (i).high > 0.0 && (i).low == 0.0 ) \ + { \ + (result).low = 0.0; \ + (result).high = 1.0; \ + } \ + } + +typedef struct +{ + Interval coord[N_DIMENSIONS]; +} IPoint; + +typedef void (*Interval_function)( int n_dimensions, + Interval parameters[], + void *function_data, + Interval *value, + Interval derivatives[] ); + +#endif diff --git a/sp_geom_prototypes.h b/sp_geom_prototypes.h new file mode 100644 index 0000000..685a299 --- /dev/null +++ b/sp_geom_prototypes.h @@ -0,0 +1,86 @@ +#ifndef DEF_sp_geom_prototypes +#define DEF_sp_geom_prototypes + +public int clip_polygons_to_plane( + polygons_struct *polygons, + Vector *plane_normal, + Real plane_constant, + polygons_struct *clipped ); + +public Real get_closed_polyhedron_volume( + polygons_struct *polygons ); + +public void tri_mesh_initialize( + tri_mesh_struct *mesh ); + +public int tri_mesh_get_n_points( + tri_mesh_struct *mesh ); + +public Status tri_mesh_output( + STRING filename, + File_formats format, + tri_mesh_struct *mesh ); + +public BOOLEAN tri_mesh_set_points( + tri_mesh_struct *mesh, + int n_points, + Point points[] ); + +public Status tri_mesh_input( + STRING filename, + File_formats format, + tri_mesh_struct *mesh ); + +public void tri_mesh_delete_edge_lookup( + tri_mesh_struct *mesh ); + +public void tri_mesh_create_edge_lookup( + tri_mesh_struct *mesh ); + +public void tri_mesh_delete( + tri_mesh_struct *mesh ); + +public void tri_mesh_delete_unused_nodes( + tri_mesh_struct *mesh ); + +public void tri_mesh_convert_from_polygons( + polygons_struct *polygons, + tri_mesh_struct *mesh ); + +public void tri_mesh_convert_to_polygons( + tri_mesh_struct *mesh, + polygons_struct *polygons ); + +public void tri_mesh_coalesce_triangles( + tri_mesh_struct *mesh, + Real min_value, + Real max_value, + int n_values, + Real values[], + Real min_size, + Real max_size ); + +public void tri_mesh_subdivide_triangles( + tri_mesh_struct *mesh, + Real min_value, + Real max_value, + int n_values, + Real values[], + Real min_size, + Real max_size, + int max_subdivisions ); + +public void tri_mesh_subdivide_bordering_triangles( + tri_mesh_struct *mesh ); + +public void tri_mesh_print_levels( + tri_mesh_struct *mesh ); + +public Status output_mesh_fixed_midpoints( + STRING filename, + tri_mesh_struct *mesh ); + +public void tri_mesh_reconcile_points( + tri_mesh_struct *dest_mesh, + tri_mesh_struct *src_mesh ); +#endif