Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

Polygons
[Geometrical Objects in BICPL]


Functions

private void reverse_polygon_order (polygons_struct *polygons, int poly)
private Real estimate_polygon_curvature (Point *point, int n_neighs, Point neighs[], Point *centroid, Vector *normal, Real *base_length)
public void initialize_polygons (polygons_struct *polygons, Colour col, Surfprop *spr)
 generate empty set of polygons

public void initialize_polygons_with_size (polygons_struct *polygons, Colour col, Surfprop *spr, int n_points, int n_polygons, int size)
 generate polygons with fixed-size facets

public void free_polygon_neighbours (polygons_struct *polygons)
public void delete_polygons (polygons_struct *polygons)
public void copy_polygons (polygons_struct *src, polygons_struct *dest)
public void set_polygon_per_item_colours (polygons_struct *polygons)
public void create_polygons_visibilities (polygons_struct *polygons)
public void set_polygons_visibilities (polygons_struct *polygons, BOOLEAN state)
public void start_new_polygon (polygons_struct *polygons)
public void add_point_to_polygon (polygons_struct *polygons, Point *point, Vector *normal)
public int get_polygon_points (polygons_struct *polygons, int poly, Point points[])
public void get_polygon_centroid (polygons_struct *polygons, int poly, Point *centroid)
public int find_vertex_index (polygons_struct *polygons, int poly, int point_index)
public int find_edge_index (polygons_struct *polygons, int poly, int point_index1, int point_index2)
public BOOLEAN find_polygon_with_edge (polygons_struct *polygons, int point_index1, int point_index2, int *poly_containing_edge, int *edge_index)
public BOOLEAN find_polygon_with_vertex (polygons_struct *polygons, int point_index, int *poly_index, int *vertex_index)
public BOOLEAN lookup_polygon_vertex (polygons_struct *polygons, Point *point, int *point_index)
public BOOLEAN find_next_edge_around_point (polygons_struct *polygons, int poly, int index_1, int index_2, int *next_poly, int *next_index_1, int *next_index_2)
public int get_neighbours_of_point (polygons_struct *polygons, int poly, int vertex_index, int neighbours[], int max_neighbours, BOOLEAN *interior_point)
public int get_polygons_around_vertex (polygons_struct *polygons, int poly, int vertex_index, int poly_indices[], int n_polys_alloced, BOOLEAN *closed_flag)
public void compute_polygon_normal (polygons_struct *polygons, int poly, Vector *normal)
public void compute_polygon_normals (polygons_struct *polygons)
public void average_polygon_normals (polygons_struct *polygons, int n_iters, Real neighbour_weight)
public BOOLEAN get_plane_polygon_intersection (Vector *normal, Real d, polygons_struct *polygons, int poly, Point intersection_points[])
public BOOLEAN get_plane_segment_intersection (Vector *normal, Real d, Point *p1, Point *p2, Point *intersection_point)
public void reverse_polygons_vertices (polygons_struct *polygons)
public void make_polygons_front_facing (polygons_struct *polygons)
public BOOLEAN polygon_is_back_facing (polygons_struct *polygons, int poly)
public void compute_points_centroid_and_normal (polygons_struct *polygons, int point_index, int n_neighbours, int neighbours[], Point *centroid, Vector *normal, Real *base_length, Real *curvature)
public void compute_polygon_point_centroid (polygons_struct *polygons, int poly, int vertex_index, int point_index, Point *centroid, Vector *normal, Real *base_length, Real *curvature)
public Real compute_polygon_vertex_curvature (polygons_struct *polygons, int point_index)
private void get_opposite_point (polygons_struct *polygons, int poly, int edge, Point *point)
public Real get_polygon_edge_angle (polygons_struct *polygons, int poly, int edge)
public BOOLEAN polygons_are_same_topology (polygons_struct *p1, polygons_struct *p2)

Detailed Description

A polygons structure contains a list of vertices and facets constructed from those vertices.

There are n_points vertices and n_items facets stored in the structure.


Function Documentation

public void add_point_to_polygon polygons_struct polygons,
Point *  point,
Vector *  normal
 

Definition at line 387 of file polygons.c.

References polygons_struct::end_indices, polygons_struct::indices, polygons_struct::n_items, polygons_struct::n_points, polygons_struct::normals, polygons_struct::points, and start_new_polygon().

Referenced by create_slice_3d().

public void average_polygon_normals polygons_struct polygons,
int  n_iters,
Real  neighbour_weight
 

Definition at line 1092 of file polygons.c.

References compute_polygon_normals(), polygons_struct::end_indices, FALSE, GET_OBJECT_SIZE, polygons_struct::indices, polygons_struct::n_items, polygons_struct::n_points, polygons_struct::normals, and POINT_INDEX.

public void compute_points_centroid_and_normal polygons_struct polygons,
int  point_index,
int  n_neighbours,
int  neighbours[],
Point *  centroid,
Vector *  normal,
Real *  base_length,
Real *  curvature
 

Definition at line 1425 of file polygons.c.

References estimate_polygon_curvature(), find_polygon_normal(), get_points_centroid(), MAX_NEIGHBOURS, and polygons_struct::points.

Referenced by compute_polygon_point_centroid(), and get_polygon_vertex_curvatures().

public void compute_polygon_normal polygons_struct polygons,
int  poly,
Vector *  normal
 

Definition at line 969 of file polygons.c.

References polygons_struct::end_indices, find_polygon_normal(), GET_OBJECT_SIZE, polygons_struct::indices, MAX_TEMP_STORAGE, POINT_INDEX, and polygons_struct::points.

Referenced by compute_polygon_normals(), and polygon_is_back_facing().

public void compute_polygon_normals polygons_struct polygons  ) 
 

Definition at line 1009 of file polygons.c.

References compute_polygon_normal(), polygons_struct::end_indices, FALSE, get_angle_between_points(), GET_OBJECT_SIZE, polygons_struct::indices, polygons_struct::n_items, polygons_struct::n_points, polygons_struct::normals, POINT_INDEX, and polygons_struct::points.

Referenced by average_polygon_normals(), create_tetrahedral_sphere(), fill_in_indices(), get_polygon_vertex_curvatures(), and io_polygons().

public void compute_polygon_point_centroid polygons_struct polygons,
int  poly,
int  vertex_index,
int  point_index,
Point *  centroid,
Vector *  normal,
Real *  base_length,
Real *  curvature
 

Definition at line 1483 of file polygons.c.

References compute_points_centroid_and_normal(), get_neighbours_of_point(), and MAX_NEIGHBOURS.

Referenced by compute_polygon_vertex_curvature(), and compute_polygons_model_info().

public Real compute_polygon_vertex_curvature polygons_struct polygons,
int  point_index
 

Definition at line 1572 of file polygons.c.

References compute_polygon_point_centroid(), and find_polygon_with_vertex().

public void copy_polygons polygons_struct src,
polygons_struct dest
 

Definition at line 221 of file polygons.c.

References polygons_struct::bintree, polygons_struct::colours, polygons_struct::end_indices, get_n_colours(), polygons_struct::indices, polygons_struct::neighbours, polygons_struct::normals, NUMBER_INDICES, polygons_struct::points, and polygons_struct::visibilities.

public void create_polygons_visibilities polygons_struct polygons  ) 
 

Definition at line 306 of file polygons.c.

References polygons_struct::n_items, TRUE, and polygons_struct::visibilities.

public void delete_polygons polygons_struct polygons  ) 
 

Definition at line 181 of file polygons.c.

References polygons_struct::bintree, polygons_struct::colour_flag, polygons_struct::colours, delete_bintree_if_any(), polygons_struct::end_indices, free_colours(), free_polygon_neighbours(), polygons_struct::indices, polygons_struct::n_items, polygons_struct::n_points, polygons_struct::normals, polygons_struct::points, and polygons_struct::visibilities.

Referenced by check_correct_general_polygons(), create_polygons_sphere(), delete_polygons_object(), remove_invisible_polygons(), and subdivide_polygons().

private Real estimate_polygon_curvature Point *  point,
int  n_neighs,
Point  neighs[],
Point *  centroid,
Vector *  normal,
Real *  base_length
 

Definition at line 1524 of file polygons.c.

References distance_between_points().

Referenced by compute_points_centroid_and_normal().

public int find_edge_index polygons_struct polygons,
int  poly,
int  point_index1,
int  point_index2
 

Definition at line 548 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, and POINT_INDEX.

Referenced by find_polygon_with_edge(), and get_polygon_edge_angle().

public BOOLEAN find_next_edge_around_point polygons_struct polygons,
int  poly,
int  index_1,
int  index_2,
int *  next_poly,
int *  next_index_1,
int *  next_index_2
 

Definition at line 717 of file polygons.c.

References polygons_struct::end_indices, find_vertex_index(), GET_OBJECT_SIZE, polygons_struct::indices, polygons_struct::neighbours, and POINT_INDEX.

Referenced by get_neighbours_of_point(), and get_polygons_around_vertex().

public BOOLEAN find_polygon_with_edge polygons_struct polygons,
int  point_index1,
int  point_index2,
int *  poly_containing_edge,
int *  edge_index
 

Definition at line 594 of file polygons.c.

References find_edge_index(), and polygons_struct::n_items.

public BOOLEAN find_polygon_with_vertex polygons_struct polygons,
int  point_index,
int *  poly_index,
int *  vertex_index
 

Definition at line 633 of file polygons.c.

References polygons_struct::end_indices, FALSE, GET_OBJECT_SIZE, polygons_struct::indices, polygons_struct::n_items, POINT_INDEX, and TRUE.

Referenced by compute_distances_from_point(), compute_polygon_vertex_curvature(), and get_subsampled_neighbours_of_point().

public int find_vertex_index polygons_struct polygons,
int  poly,
int  point_index
 

Definition at line 507 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, and POINT_INDEX.

Referenced by find_next_edge_around_point().

public void free_polygon_neighbours polygons_struct polygons  ) 
 

Definition at line 158 of file polygons.c.

References polygons_struct::neighbours.

Referenced by delete_polygons().

public int get_neighbours_of_point polygons_struct polygons,
int  poly,
int  vertex_index,
int  neighbours[],
int  max_neighbours,
BOOLEAN *  interior_point
 

Definition at line 783 of file polygons.c.

References polygons_struct::end_indices, find_next_edge_around_point(), GET_OBJECT_SIZE, polygons_struct::indices, and POINT_INDEX.

Referenced by compute_polygon_point_centroid(), get_subsampled_neighbours_of_point(), and update_point_position().

private void get_opposite_point polygons_struct polygons,
int  poly,
int  edge,
Point *  point
 

Definition at line 1609 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, POINT_INDEX, and polygons_struct::points.

Referenced by get_polygon_edge_angle().

public BOOLEAN get_plane_polygon_intersection Vector *  normal,
Real  d,
polygons_struct polygons,
int  poly,
Point  intersection_points[]
 

Definition at line 1195 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, get_plane_segment_intersection(), polygons_struct::indices, POINT_INDEX, and polygons_struct::points.

public BOOLEAN get_plane_segment_intersection Vector *  normal,
Real  d,
Point *  p1,
Point *  p2,
Point *  intersection_point
 

Definition at line 1244 of file polygons.c.

References FALSE, and TRUE.

Referenced by get_plane_polygon_intersection().

public void get_polygon_centroid polygons_struct polygons,
int  poly,
Point *  centroid
 

Definition at line 468 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, POINT_INDEX, and polygons_struct::points.

public Real get_polygon_edge_angle polygons_struct polygons,
int  poly,
int  edge
 

Definition at line 1643 of file polygons.c.

References compute_clockwise_rotation(), polygons_struct::end_indices, find_edge_index(), GET_OBJECT_SIZE, get_opposite_point(), polygons_struct::indices, polygons_struct::neighbours, POINT_INDEX, polygons_struct::points, and y.

public int get_polygon_points polygons_struct polygons,
int  poly,
Point  points[]
 

Definition at line 436 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, POINT_INDEX, and polygons_struct::points.

Referenced by create_polygons_bintree(), find_closest_polygon_point(), get_point_polygon_distance_sq(), get_point_polygon_vertex_distance(), get_polygons_surface_area(), and map_point_between_polygons().

public int get_polygons_around_vertex polygons_struct polygons,
int  poly,
int  vertex_index,
int  poly_indices[],
int  n_polys_alloced,
BOOLEAN *  closed_flag
 

Definition at line 900 of file polygons.c.

References FALSE, find_next_edge_around_point(), GET_OBJECT_SIZE, and TRUE.

public void initialize_polygons polygons_struct polygons,
Colour  col,
Surfprop *  spr
 

generate empty set of polygons

Generates a valid polygons instance, with the given colour and surface properties.

Parameters:
polygons pointer to allocated structure
col colour for polygons
spr surface properties (or NULL for defaults)

Definition at line 72 of file polygons.c.

References polygons_struct::bintree, polygons_struct::colour_flag, polygons_struct::colours, polygons_struct::end_indices, get_default_surfprop(), polygons_struct::indices, polygons_struct::line_thickness, polygons_struct::n_items, polygons_struct::n_points, polygons_struct::neighbours, polygons_struct::normals, ONE_COLOUR, polygons_struct::points, polygons_struct::surfprop, and polygons_struct::visibilities.

Referenced by create_polygons_sphere(), create_slice_3d(), initialize_polygons_with_size(), and io_polygons().

public void initialize_polygons_with_size polygons_struct polygons,
Colour  col,
Surfprop *  spr,
int  n_points,
int  n_polygons,
int  size
 

generate polygons with fixed-size facets

Partially initialize a polygons instance. To finish the description, the points, normals, and indices arrays must be filled in. The rest of the fields (including end_indices) are filled in by this routine.

Parameters:
polygons pointer to allocated structure
col colour for polygons
spr surface properties (or NULL)
n_points number of vertices
n_polygons number of facets
size number of vertices per facet

Definition at line 119 of file polygons.c.

References polygons_struct::end_indices, polygons_struct::indices, initialize_polygons(), polygons_struct::n_items, polygons_struct::n_points, polygons_struct::normals, and polygons_struct::points.

Referenced by create_unit_cube(), create_unit_icosahedron(), create_unit_octohedron(), and create_unit_tetrahedron().

public BOOLEAN lookup_polygon_vertex polygons_struct polygons,
Point *  point,
int *  point_index
 

Definition at line 677 of file polygons.c.

References polygons_struct::n_points, and polygons_struct::points.

Referenced by compute_distances_from_point().

public void make_polygons_front_facing polygons_struct polygons  ) 
 

Definition at line 1317 of file polygons.c.

References polygons_struct::n_items, polygons_struct::neighbours, polygon_is_back_facing(), and reverse_polygon_order().

public BOOLEAN polygon_is_back_facing polygons_struct polygons,
int  poly
 

Definition at line 1347 of file polygons.c.

References compute_polygon_normal(), polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, polygons_struct::normals, and POINT_INDEX.

Referenced by make_polygons_front_facing().

public BOOLEAN polygons_are_same_topology polygons_struct p1,
polygons_struct p2
 

Definition at line 1718 of file polygons.c.

References polygons_struct::end_indices, polygons_struct::indices, polygons_struct::n_items, polygons_struct::n_points, and objects_are_same_topology().

Referenced by polygon_transform_points().

private void reverse_polygon_order polygons_struct polygons,
int  poly
 

Definition at line 1385 of file polygons.c.

References polygons_struct::end_indices, GET_OBJECT_SIZE, polygons_struct::indices, and POINT_INDEX.

Referenced by make_polygons_front_facing(), and reverse_polygons_vertices().

public void reverse_polygons_vertices polygons_struct polygons  ) 
 

Definition at line 1291 of file polygons.c.

References polygons_struct::n_items, polygons_struct::neighbours, and reverse_polygon_order().

public void set_polygon_per_item_colours polygons_struct polygons  ) 
 

Definition at line 275 of file polygons.c.

References polygons_struct::colour_flag, polygons_struct::colours, polygons_struct::n_items, and PER_ITEM_COLOURS.

public void set_polygons_visibilities polygons_struct polygons,
BOOLEAN  state
 

Definition at line 335 of file polygons.c.

References polygons_struct::n_items, and polygons_struct::visibilities.

public void start_new_polygon polygons_struct polygons  ) 
 

Definition at line 361 of file polygons.c.

References polygons_struct::end_indices, polygons_struct::n_items, and NUMBER_INDICES.

Referenced by add_point_to_polygon().


Generated on Wed Jul 28 09:11:25 2004 for BICPL by doxygen 1.3.7