Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Definition

A class Pm_traits that satisfies the requirements of an interface class for a planar map class must provide the following types and operations.

Types

The geometric types defined below must have a default constructor, copy constructor, assignment operator and operator==.

Pm_traits::Point
A type to hold the location of a vertex in the plane.


Pm_traits::X_curve
A type to hold an x-monotone curve in the plane.


enum Curve_point_status { UNDER_CURVE = -1,
CURVE_NOT_IN_RANGE,
ABOVE_CURVE,
ON_CURVE};
a constant describing the relative position between a curve and a point.

Creation

Pm_traits pm_traits;
A default constructor.

Operations

Comparison_result pm_traits.compare_x ( Point p0, Point p1)
compares the x-coordinates of p0 and p1. Return LARGER if x(p0) > x(p1), SMALLER if x(p0) < x(p1), or else EQUAL.

Comparison_result pm_traits.compare_y ( Point p0, Point p1)
compares the y-coordinates of p0 and p1.

bool pm_traits.curve_is_vertical ( X_curve cv)
returns true if cv is a vertical segment.

bool pm_traits.curve_is_in_x_range ( X_curve cv, Point pnt)
returns true if pnt is in the x range of cv.

Comparison_result
pm_traits.curve_compare_at_x ( X_curve cv1,
X_curve cv2,
Point pnt)
compares the y-coordinate of cv1 and cv2 at the x-coordinate of pnt. Return EQUAL if at least one of cv1 and cv2 is not defined at pnt's x-coordinate.

Comparison_result
pm_traits.curve_compare_at_x_left ( X_curve cv1,
X_curve cv2,
Point pnt)
compares the y-coordinate of cv1 and cv2 immediately to the left of the x-coordinate of pnt. Return EQUAL if at least one of cv1 and cv2 is not defined to the left of pnt's x-coordinate.

Comparison_result
pm_traits.curve_compare_at_x_right ( X_curve cv1,
X_curve cv2,
Point pnt)
compares the y-coordinate of cv1 and cv2 immediately to the right of the x-coordinate of pnt. Return EQUAL if at least one of cv1 and cv2 is not defined to the right of pnt's x-coordinate.

Curve_point_status
pm_traits.curve_get_point_status ( X_curve cv,
Point pnt)
returns a constant describing the relative position between cv and pnt:
    CURVE_NOT_IN_RANGE - pnt is not in the x-range of cv,
    UNDER_CURVE - pnt is below cv,
    ABOVE_CURVE - pnt is above cv, and
    ON_CURVE - pnt is on cv.

bool
pm_traits.curve_is_between_cw ( X_curve cv,
X_curve first,
X_curve second,
Point pnt)
given three curves that share an endpoint pnt, returns true if cv is between first and second, when going in the clockwise direction around pnt from first to second.

bool pm_traits.curve_is_same ( X_curve cv1, X_cur ve cv2)
returns true if cv1 is the same as cv2.

Point pm_traits.curve_source ( X_curve cv)
returns the source of cv.

Point pm_traits.curve_target ( X_curve cv)
returns the target of cv.

Point pm_traits.point_to_left ( Point p)
returns a point to the left of p.

Point pm_traits.point_to_right ( Point p)
returns a point to the right of p.


Next: Class declaration of Pm_segment_exact_traits<R>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.