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

scan_polygons.c File Reference

#include <volume_io/internal_volume_io.h>
#include <bicpl.h>

Include dependency graph for scan_polygons.c:

Include dependency graph

Go to the source code of this file.

Defines

#define MAX_TEMP_STORAGE   1000

Functions

private void recursive_scan_polygon_to_voxels (int size, Point points[], Volume label_volume, int label, int min_voxel[], int max_voxel[])
 Helper for scan_a_polygon.

private void scan_a_polygon (int size, Point vertices[], Point voxels[], int n_output_vertices, Point output_vertices[], Volume volume, Volume label_volume, int sizes[], int label)
 Label all voxels of a single polygon.

public void scan_polygons_to_voxels (polygons_struct *polygons, Volume volume, Volume label_volume, int label, Real max_distance)
 Add label to all voxels that intersect polygons.

public void scan_quadmesh_to_voxels (quadmesh_struct *quadmesh, Volume volume, Volume label_volume, int label, Real max_distance)
 Add label to all voxels that intersect a quadmesh.


Define Documentation

#define MAX_TEMP_STORAGE   1000
 

Definition at line 22 of file scan_polygons.c.


Function Documentation

private void recursive_scan_polygon_to_voxels int  size,
Point  points[],
Volume  label_volume,
int  label,
int  min_voxel[],
int  max_voxel[]
 

Helper for scan_a_polygon.

Assign the label value to each voxel that intersects the polygon. I suspect the algorithm assumes a planar, convex polygon. The input parameters min_voxel and max_voxel specify a bounding box around the polygon, in voxel coordinates

Parameters:
size number of points in polygon
points array of polygon vertex coordinates
label_volume output volume
label value to store in label_volume
min_voxel array of minimum voxel values
max_voxel array of maximum voxel values

Definition at line 40 of file scan_polygons.c.

References MAX_TEMP_STORAGE, set_volume_label_data(), and split_polygon_with_plane().

Referenced by scan_a_polygon().

private void scan_a_polygon int  size,
Point  vertices[],
Point  voxels[],
int  n_output_vertices,
Point  output_vertices[],
Volume  volume,
Volume  label_volume,
int  sizes[],
int  label
 

Label all voxels of a single polygon.

Parameters:
size number of vertices in the polygon
vertices array of vertex coordinates
voxels array of vertex coordinates in voxel space
n_output_vertices size of output_vertices array
output_vertices array of vertex coordinates (in voxel space) after clipping input polygon to volume boundaries
volume specifies world-to-volume transformation
label_volume output volume
sizes number of voxels in each dimension of volume
label value to store in label_volume

Definition at line 134 of file scan_polygons.c.

References clip_polygon_against_box(), and recursive_scan_polygon_to_voxels().

Referenced by scan_polygons_to_voxels(), and scan_quadmesh_to_voxels().

public void scan_polygons_to_voxels polygons_struct polygons,
Volume  volume,
Volume  label_volume,
int  label,
Real  max_distance
 

Add label to all voxels that intersect polygons.

Parameters:
polygons list of polygons to scan
volume specifies world-to-volume transformation
label_volume output volume
label value to store in label_volume
max_distance ignored

Definition at line 240 of file scan_polygons.c.

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

Referenced by scan_object_to_volume().

public void scan_quadmesh_to_voxels quadmesh_struct quadmesh,
Volume  volume,
Volume  label_volume,
int  label,
Real  max_distance
 

Add label to all voxels that intersect a quadmesh.

Parameters:
quadmesh the mesh to scan
volume specifies world-to-volume transformation
label_volume output volume
label value to store in label_volume
max_distance ignored

Definition at line 314 of file scan_polygons.c.

References get_quadmesh_n_objects(), get_quadmesh_patch(), and scan_a_polygon().

Referenced by scan_object_to_volume().


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