.\" XXX standard disclaimer belongs here....
.\" $Header: RCS/system,v 1.1 90/07/18 16:19:23 mao Exp $
.SP "SYSTEM TYPES" POSTQUEL 6/14/90
.XA 1 "Type Management for System Types (System Types)"
.\" .XA 2 "System Types" _
.\" .XA 2 "System Functions" _
.\" .XA 2 "System Operators" _
.uh DESCRIPTION
.lp
This section describes the available system data types and their
associated functions and operators
available in Version 2.
These types are installed in every \*(PP data base automatically.
The \*(PP system administrator can change them by editing
.(l
\&.../files/local1_template1.ami
.)l
as explained in local template (files).
.sp
The default system types are:
.(l
point		data point type
lseg		line segment type
path		variable length array of lseg
box		2d rectangle type
.)l
The intent of including these particular types and their associated functions
and operators is to provide an example of a suite of user data types.
No claim is made that they are useful or efficient.
.uh FUNCTIONS
.lp
The following functions are defined on system types.
.sp
.TS
l l l.
_
\fIreturn	function name 
type	and argument types	meaning\fR
_
bool	box_overlap(box,box)	tests for overlapping boxes
bool	box_ge(box,box) 	tests for area greater than or equal, >=
bool	box_gt(box, box)	tests for area greater than, >
bool	box_eq(box,box)	tests for area equality, =
bool	box_lt(box,box)	tests for area less than, <
bool	box_le(box,box)	tests for area less than or equal, <=
bool	point_above(point,point)	tests if point is above point
bool	point_left(point,point)	tests if point is left of point
bool	point_right(point,point)	tests if point is right of point
bool	point_below(point,point)	tests if point is below point
bool	point_eq(point,point)	tests for equality
bool	inside(point,box)	tests if point is in box
bool	on_ppath(point,path)	tests if point lies on path

external	point_out(point)	converts argument from internal to external form
external	lseg_out(lseg)	          "
external	path_out(path)	          "
external	box_out(box)	          "

point	point_in(external)	converts argument from external to internal form
lseg	lseg_in(external)	          "
path	path_in(external)	          "
box	box_in(external)	          "

int4	pointdist(point,point)	determines distance between two points

point	box_center(box)	locates center of box
.TE
.uh OPERATORS
.lp
.TS
l l l.
_
\fIbinary	result	supporting
operator	type	procedure\fR
_
\= 	bool	box_eq(box,box),
&&	bool	box_overlap(box,box)
\=|=	bool	point_eq(point,point)
!^	bool	point_above(point,point)
!<	bool	point_left(point,point)
!>	bool	point_right(point,point)
!|	bool	point_below(point,point)
\-\-\->	bool	inside(point,box)
\-\-\-`	bool	on_ppath(point,path)
.i "spatial comparison"

<	bool	box_lt(box,box)
>=	bool	box_ge(box,box)
>	bool	box_gt(box,box)
<=	bool	box_le(box,box)
.i "area comparison"

<\-\-\->	int4	point_dist(point,point)
.i distance

_
\fIunary left	result	supporting
operators	type	procedure\fR
_
@@	point	box_center(box)
.i "center of box"
.TE
