Data Structures | |
struct | quadmesh_struct |
In-memory structure for a quadrilateral mesh. More... | |
Functions | |
public void | initialize_quadmesh (quadmesh_struct *quadmesh, Colour col, Surfprop *spr, int m, int n) |
Initialize a quadmesh to given size. | |
public void | delete_quadmesh (quadmesh_struct *quadmesh) |
Delete quadmesh structure. | |
public void | set_quadmesh_point (quadmesh_struct *quadmesh, int i, int j, Point *point, Vector *normal) |
Set one point and normal in quadmesh. | |
public BOOLEAN | get_quadmesh_point (const quadmesh_struct *quadmesh, int i, int j, Point *point) |
Get coordinates of one point in quadmesh. | |
public void | get_quadmesh_n_objects (const quadmesh_struct *quadmesh, int *mp, int *np) |
public void | compute_quadmesh_normals (quadmesh_struct *quadmesh) |
public void | get_quadmesh_patch_indices (const quadmesh_struct *quadmesh, int i, int j, int indices[]) |
Compute the indices of points for patch. | |
public void | get_quadmesh_patch (const quadmesh_struct *quadmesh, int i, int j, Point points[]) |
Get coordinates of patch corners. | |
public void | reverse_quadmesh_vertices (quadmesh_struct *quadmesh) |
Flip columns around centre. |
Point locations in a quadmesh are addressed using integer pairs (i,j) with 0 <= i < m, and 0 <= j < n.
Each quadrilateral of the mesh, or patch, is defined by the four points at its corners. The set of points comprising the interior of the patch is undefined. Four points are not planar, in general.
Patches are addressed using integer pairs (i,j) with 0 <= i < mp, and 0 <= j < np. Use get_quadmesh_n_objects() to compute mp
and np
.
Routines dealing with quadmeshes generally take a pointer to a quadmesh_struct as their first argument.
|
Compute all normal vectors in quadmesh. Use find_polygon_normal() to set normal from location of the point's 4-neighbours.
Definition at line 299 of file quadmesh.c. References FALSE, find_polygon_normal(), get_quadmesh_point(), quadmesh_struct::m, quadmesh_struct::n, quadmesh_struct::normals, and quadmesh_struct::points. Referenced by create_lsq_hypersurface_float(). |
|
Delete quadmesh structure.
Definition at line 130 of file quadmesh.c. References quadmesh_struct::bintree, quadmesh_struct::colour_flag, quadmesh_struct::colours, delete_bintree_if_any(), free_colours(), quadmesh_struct::m, quadmesh_struct::n, quadmesh_struct::normals, and quadmesh_struct::points. Referenced by delete_quadmesh_object(). |
|
Compute the number of patches in the quadmesh.
If the quadmesh has The mesh has mp*np patches, in total.
Definition at line 262 of file quadmesh.c. References quadmesh_struct::m, quadmesh_struct::m_closed, quadmesh_struct::n, and quadmesh_struct::n_closed. Referenced by create_quadmesh_bintree(), find_closest_point_on_object(), get_point_quadmesh_distance_sq(), intersect_planes_with_quadmesh(), intersect_ray_quadmesh_patch(), intersect_ray_with_object(), and scan_quadmesh_to_voxels(). |
|
Get coordinates of patch corners.
A patch is addressed by a pair of integers (i,j) for 0 <= i < mp, and 0 <= j < np, where
Definition at line 422 of file quadmesh.c. References get_quadmesh_patch_indices(), and quadmesh_struct::points. Referenced by create_quadmesh_bintree(), get_point_quadmesh_distance_sq(), intersect_ray_quadmesh_patch(), and scan_quadmesh_to_voxels(). |
|
Compute the indices of points for patch.
A patch is addressed by a pair of integers (i,j) for 0 <= i < mp, and 0 <= j < np, where
Definition at line 384 of file quadmesh.c. References quadmesh_struct::m, and quadmesh_struct::n. Referenced by get_quadmesh_patch(). |
|
Get coordinates of one point in quadmesh.
Definition at line 220 of file quadmesh.c. References FALSE, quadmesh_struct::m, quadmesh_struct::n, quadmesh_struct::points, and TRUE. Referenced by compute_quadmesh_normals(). |
|
Initialize a quadmesh to given size. The resulting quadmesh uses a single colour, and is open along the row and column directions. Space is allocated for points and normals, but not initialized.
Definition at line 84 of file quadmesh.c. References quadmesh_struct::bintree, quadmesh_struct::colour_flag, quadmesh_struct::colours, FALSE, get_default_surfprop(), quadmesh_struct::m, quadmesh_struct::m_closed, quadmesh_struct::n, quadmesh_struct::n_closed, quadmesh_struct::normals, ONE_COLOUR, quadmesh_struct::points, and quadmesh_struct::surfprop. Referenced by create_lsq_hypersurface_float(), create_slice_quadmesh(), create_tube(), and io_quadmesh(). |
|
Flip columns around centre. Flip the quadmesh about its middle column, swapping point and normal information in column 0 with column n-1, etc. Definition at line 442 of file quadmesh.c. References quadmesh_struct::m, quadmesh_struct::n, quadmesh_struct::normals, and quadmesh_struct::points. |
|
Set one point and normal in quadmesh.
Definition at line 176 of file quadmesh.c. References quadmesh_struct::n, quadmesh_struct::normals, and quadmesh_struct::points. Referenced by create_lsq_hypersurface_float(), and create_slice_quadmesh(). |