Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mlib::XYpt_list Class Reference
["XY" Coordinate System]

A list of points in XY coordinates. More...

#include <points.H>

Inheritance diagram for mlib::XYpt_list:

Inheritance graph
[legend]
Collaboration diagram for mlib::XYpt_list:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Point2list (int m=16)
 Construct a list with no points but space for m points.
 Point2list (const ARRAY< XYpt > &p)
 Construct a list using the passed in array of points.
double winding_number (const XYpt &) const
 Returns the winding number.
bool intersects_line (const XYline &line) const
 Returns true if any segment of the polyline crosses the line.
bool intersects_seg (const XYline &segment) const
 Returns true if any segment of the polyline crosses the given line segment.
int contains (const Point2list< XYpt_list, XYpt, XYvec, XYline > &list) const
int contains (const XYpt &p) const
bool contains (const P &el) const
bool ray_intersect (const XYpt &p, const XYvec &d, XYpt &hit, int loop=0) const
bool ray_intersect (const XYpt &p, const XYvec &d, XYpt_list &hit, int loop=0) const
XYpt ray_intersect (const XYpt &p, const XYvec &d, int k0, int k1) const
void fix_endpoints (XYpta, XYptb)
 Adjust this polyline so that it runs from a to b (uses a combination of translation, rotation, and scaling).
 ARRAY (int m=0)
 ARRAY (CARRAY< P > &l)
int num () const
bool empty () const
bool valid_index (int k) const
void set_unique ()
P * array ()
P & operator[] (int j) const
P & last () const
P & first () const
void begin_index ()
void end_index ()
bool is_indexing () const
virtual void truncate (int n)
virtual void realloc (int new_max=0)
virtual int get_index (const P &el) const
bool add_uniquely (const P &el)
void operator+= (const P &el)
ARRAY< P > & operator+= (CARRAY< P > &b)
void add (const P &p)
void push (const P &p)
void insert (int ind, int num)
bool remove (int k)
bool operator-= (const P &el)
void operator-= (CARRAY< P > &l)
bool rem (const P &p)
pop ()
bool pull_index (int k)
bool pull_element (const P &p)
ARRAY< P > extract (int start, int n) const
virtual void reverse ()
virtual void sort (compare_func_t compare)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)
Constructors
 XYpt_list (int m=0)
 XYpt_list (const Point2list< XYpt_list, XYpt, XYvec, XYline > &p)
Projection Functions
void project_to_plane (CWplane &P, Wpt_list &pts) const
Point, Vector and Segment Accessors
pt (int i) const
 Get the ith point in the list.
vec (int i) const
 Get the vector from the ith point in the list to the (i + 1)th point in the list.
double segment_length (int i) const
 Get the length of the ith segment in the list.
seg (int i) const
 Get the ith segment in the list.
tan (int i) const
 Returns a "tangent" direction at each vertex.
Point List Property Queries
bool is_closed () const
 It's considered a closed loop if the first and last point are the same.
bool is_straight (double len_scale=1e-5) const
 Returns true if the points fall in a straight line.
bool self_intersects () const
 Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.
Near Point Functions
Functions for finding the nearest point in a point list to another point.

int nearest_point (const P &p) const
 Finds the index of the nearest point in the point list to point p.
void closest (const P &p, P &, double &, int &) const
 Computes everything about the point on the line closest to p.
double closest (const P &p, P &, int &) const
closest (const P &p) const
Geometric Computations
sum () const
 Computes the sum of all the points in the list.
average () const
 Computes the average of all the point sin the list.
double dist_to_seg (const P &p, int k) const
 Computes the distance from point p to the nearest point on segment k in the list.
double avg_dist_to_seg (const P &p, int k) const
 Computes the averge distance from point p to segment k in the list over the length of segment k.
double dist (const P &p) const
 Distance of the point to the nearest point on the polyline.
double spread () const
 Max distance of any point to average().
P::value_type min_val (int i) const
 Returns the min value, over the polyline, for the given component i.
P::value_type max_val (int i) const
 Returns the max value, over the polyline, for the given component i.
Length Functions
void update_length ()
double partial_length (int i) const
 Net length along the polyline at vertex i.
double length () const
double avg_len () const
Interpolation Functions
interpolate (double s, V *tan=0, int *segp=0, double *tp=0) const
 Computes interpolated values over the polyline.
void interpolate_length (double s, int &seg, double &t) const
 Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).
get_tangent (double s) const
 Computes the interpolated tangent at s on the polyline.
Inversion Functions
double invert (const P &p) const
double invert (const P &p, int seg) const
List Operations
void translate (const V &vec)
 Translate all points in polyline by given vector.
void resample (int num_segs)
 Resample with the desired number of segments:.
List Editing Functions
clone_piece (int k1, int k2) const
 Make a copy of the point list from point k1 to point k2.
void append (Pointlist< L, P, V, S > *poly)
 Appends all the points in poly onto the list.
void prepend (Pointlist< L, P, V, S > *poly)
 Prepends all the points in poly onto the list.
Overriden ARRAY Class Virtual Methods
virtual void clear ()
virtual void shift (int p)

Protected Member Functions

virtual void set_index (const P &, int) const
virtual void clear_index (const P &) const
virtual void clear_ele (int)
virtual void clear_range (int i, int j)
virtual void append_ele (const P &el)

Protected Attributes

ARRAY< double > _partial_length
P * _array
int _num
int _max
bool _unique
bool _do_index

Detailed Description

A list of points in XY coordinates.

Definition at line 621 of file points.H.


Constructor & Destructor Documentation

mlib::XYpt_list::XYpt_list int  m = 0  )  [inline]
 

Definition at line 628 of file points.H.

mlib::XYpt_list::XYpt_list const Point2list< XYpt_list, XYpt, XYvec, XYline > &  p  )  [inline]
 

Definition at line 630 of file points.H.


Member Function Documentation

void ARRAY< P >::add const P &  p  )  [inline, inherited]
 

Definition at line 306 of file support.H.

Referenced by mlib::PIXEL_list::operator=(), and mlib::NDCpt_list::operator=().

bool ARRAY< P >::add_uniquely const P &  el  )  [inline, inherited]
 

Definition at line 289 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE void mlib::Pointlist< L, P, V, S >::append Pointlist< L, P, V, S > *  poly  )  [inherited]
 

Appends all the points in poly onto the list.

Definition at line 542 of file pointlist.C.

References ARRAY< P >::operator+=().

virtual void ARRAY< P >::append_ele const P &  el  )  [inline, protected, virtual, inherited]
 

Definition at line 154 of file support.H.

P * ARRAY< P >::array  )  [inline, inherited]
 

Definition at line 189 of file support.H.

ARRAY< P >::ARRAY CARRAY< P > &  l  )  [inline, inherited]
 

Definition at line 177 of file support.H.

ARRAY< P >::ARRAY int  m = 0  )  [inline, inherited]
 

Definition at line 173 of file support.H.

template<class L, class P, class V, class S>
P mlib::Pointlist< L, P, V, S >::average  )  const [inline, inherited]
 

Computes the average of all the point sin the list.

Definition at line 130 of file pointlist.H.

Referenced by GESTURE::center(), Bvert_list::center(), mlib::Wpt_list::get_best_fit_plane(), GESTURE::is_ellipse(), and mlib::Pointlist< L, P, V, S >::spread().

template<class L, class P, class V, class S>
MLIB_INLINE double mlib::Pointlist< L, P, V, S >::avg_dist_to_seg const P &  p,
int  k
const [inherited]
 

Computes the averge distance from point p to segment k in the list over the length of segment k.

Definition at line 216 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::length(), and ARRAY< P >::num().

template<class L, class P, class V, class S>
double mlib::Pointlist< L, P, V, S >::avg_len  )  const [inline, inherited]
 

Definition at line 170 of file pointlist.H.

void ARRAY< P >::begin_index  )  [inline, inherited]
 

Definition at line 206 of file support.H.

template<class L, class P, class V, class S>
virtual void mlib::Pointlist< L, P, V, S >::clear void   )  [inline, virtual, inherited]
 

Reimplemented from ARRAY< P >.

Definition at line 230 of file pointlist.H.

Referenced by BMESH::_merge(), UVMapping::add_face(), BMESH::changed(), LINE3D::clear(), mlib::PIXEL_list::operator=(), mlib::NDCpt_list::operator=(), BBOX::points(), mlib::Pointlist< L, P, V, S >::prepend(), mlib::Wpt_list::project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), project_to_plane(), ELLIPSE::rebuild(), mlib::EDGElist::reset(), BODY::triangulate(), and BMESH::triangulate().

virtual void ARRAY< P >::clear_ele int   )  [inline, protected, virtual, inherited]
 

Definition at line 143 of file support.H.

virtual void ARRAY< P >::clear_index const P &   )  const [inline, protected, virtual, inherited]
 

Definition at line 137 of file support.H.

virtual void ARRAY< P >::clear_range int  i,
int  j
[inline, protected, virtual, inherited]
 

Definition at line 146 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE L mlib::Pointlist< L, P, V, S >::clone_piece int  k1,
int  k2
const [inherited]
 

Make a copy of the point list from point k1 to point k2.

Parameters:
[in] k1 Index of first vertex.
[in] k2 Index of last vertex.
Warning:
Allocates memory for the copied list. Presumably the caller is responsible for deallocating this memory (using delete).

Definition at line 511 of file pointlist.C.

References ARRAY< P >::num(), and ARRAY< P >::valid_index().

template<class L, class P, class V, class S>
MLIB_INLINE P mlib::Pointlist< L, P, V, S >::closest const P &  p  )  const [inherited]
 

Definition at line 175 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::closest(), and mlib::Pointlist< L, P, V, S >::dist().

template<class L, class P, class V, class S>
MLIB_INLINE double mlib::Pointlist< L, P, V, S >::closest const P &  p,
P &  ,
int & 
const [inherited]
 

Definition at line 151 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::closest(), mlib::Pointlist< L, P, V, S >::length(), and ARRAY< P >::num().

template<class L, class P, class V, class S>
MLIB_INLINE void mlib::Pointlist< L, P, V, S >::closest const P &  p,
P &  nearpt,
double &  neardist,
int &  seg_index
const [inherited]
 

Computes everything about the point on the line closest to p.

Returns:
the point, its distance to the line, and the index of the point that starts its segment. (that is, the point is on the line segment between points [seg_index] and [seg_index+1])

Definition at line 112 of file pointlist.C.

References ARRAY< P >::empty(), err_msg(), mlib::nearest_pt_to_line_seg(), and ARRAY< P >::num().

Referenced by mlib::Pointlist< L, P, V, S >::closest(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::dist(), mlib::Pointlist< L, P, V, S >::invert(), and trim_endpt_overlap().

bool ARRAY< P >::contains const P &  el  )  const [inline, inherited]
 

Reimplemented in mlib::Point2list< L, P, V, S >.

Definition at line 283 of file support.H.

int mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::contains const XYpt p  )  const [inherited]
 

int mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::contains const Point2list< XYpt_list , XYpt , XYvec , XYline > &  list  )  const [inherited]
 

template<class L, class P, class V, class S>
double mlib::Pointlist< L, P, V, S >::dist const P &  p  )  const [inline, inherited]
 

Distance of the point to the nearest point on the polyline.

Definition at line 141 of file pointlist.H.

Referenced by ELLIPSE::avg_dist(), mlib::Pointlist< L, P, V, S >::closest(), mlib::Pointlist< L, P, V, S >::nearest_point(), and GESTURE::radius().

template<class L, class P, class V, class S>
MLIB_INLINE double mlib::Pointlist< L, P, V, S >::dist_to_seg const P &  p,
int  k
const [inherited]
 

Computes the distance from point p to the nearest point on segment k in the list.

Definition at line 203 of file pointlist.C.

References mlib::nearest_pt_to_line_seg(), and ARRAY< P >::num().

bool ARRAY< P >::empty  )  const [inline, inherited]
 

Definition at line 185 of file support.H.

Referenced by mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::average(), mlib::Pointlist< L, P, V, S >::closest(), mlib::Pointlist< L, P, V, S >::interpolate(), mlib::Pointlist< L, P, V, S >::interpolate_length(), mlib::Pointlist< L, P, V, S >::max_val(), mlib::Pointlist< L, P, V, S >::min_val(), mlib::Wpt_list::project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), project_to_plane(), and mlib::Pointlist< L, P, V, S >::spread().

void ARRAY< P >::end_index  )  [inline, inherited]
 

Definition at line 213 of file support.H.

ARRAY<P > ARRAY< P >::extract int  start,
int  n
const [inline, inherited]
 

Definition at line 417 of file support.H.

P & ARRAY< P >::first  )  const [inline, inherited]
 

Definition at line 198 of file support.H.

Referenced by mlib::Point2list< L, P, V, S >::fix_endpoints().

void mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::fix_endpoints XYpt   a,
XYpt   b
[inherited]
 

Adjust this polyline so that it runs from a to b (uses a combination of translation, rotation, and scaling).

Pass input parameters by copying in case one is a current endpoint of the polyline.

virtual int ARRAY< P >::get_index const P &  el  )  const [inline, virtual, inherited]
 

Definition at line 275 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE V mlib::Pointlist< L, P, V, S >::get_tangent double  s  )  const [inherited]
 

Computes the interpolated tangent at s on the polyline.

Definition at line 413 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::interpolate_length(), ARRAY< P >::num(), and mlib::Pointlist< L, P, V, S >::seg().

void ARRAY< P >::insert int  ind,
int  num
[inline, inherited]
 

Definition at line 319 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE P mlib::Pointlist< L, P, V, S >::interpolate double  s,
V *  tan = 0,
int *  segp = 0,
double *  tp = 0
const [inherited]
 

Computes interpolated values over the polyline.

Given interpolation parameter s varying from 0 to 1 along the polyline, return the corresponding point, and optionally the tangent, segment index, and segment paramter there.

Parameters:
[in] s Interpolation parameter. Varies from 0 to 1 (0 is the begining of the line and 1 is the end).
[out] tan Tanget of segment segp (pass NULL if you don't want it).
[out] segp Index of the segment that contains the interpolated position at s (pass NULL if you don't want it).
[out] tp Parameter varying from 0 to 1 representing the corresponding position of s on the segment segp (pass NULL if you don't want it).
Returns:
The interpolated point along on the polyline at s.

Definition at line 322 of file pointlist.C.

References ARRAY< P >::empty(), mlib::Pointlist< L, P, V, S >::interpolate_length(), and mlib::Pointlist< L, P, V, S >::seg().

Referenced by get_section(), LINE3D::point(), mlib::Pointlist< L, P, V, S >::resample(), GESTURE::startup_time(), and trim_endpt_overlap().

template<class L, class P, class V, class S>
MLIB_INLINE void mlib::Pointlist< L, P, V, S >::interpolate_length double  s,
int &  seg,
double &  t
const [inherited]
 

Finds the segment containing the interpolation paramenter s and the position of s within that segment (as a parameter between 0 and 1).

Parameter s should lie in the range [0,1]. Returns the corresponding segment index, and the paramter t varying from 0 to 1 along that segment.

Parameters:
[in] s Interpolation parameter. Varies from 0 to 1 (0 is the begining of the line and 1 is the end).
[out] seg Index of the segment that contains the interpolated position at s.
[out] t Parameter varying from 0 to 1 representing the corresponding position of s on the segment seg.

Definition at line 363 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::_partial_length, ARRAY< P >::empty(), ARRAY< T >::last(), ARRAY< P >::num(), and ARRAY< T >::num().

Referenced by mlib::Pointlist< L, P, V, S >::get_tangent(), mlib::Pointlist< L, P, V, S >::interpolate(), and GESTURE::winding().

bool mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::intersects_line const XYline line  )  const [inherited]
 

Returns true if any segment of the polyline crosses the line.

bool mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::intersects_seg const XYline segment  )  const [inherited]
 

Returns true if any segment of the polyline crosses the given line segment.

template<class L, class P, class V, class S>
MLIB_INLINE double mlib::Pointlist< L, P, V, S >::invert const P &  p,
int  seg
const [inherited]
 

Definition at line 469 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::_partial_length, and mlib::Pointlist< L, P, V, S >::length().

template<class L, class P, class V, class S>
MLIB_INLINE double mlib::Pointlist< L, P, V, S >::invert const P &  p  )  const [inherited]
 

Definition at line 455 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::closest().

template<class L, class P, class V, class S>
bool mlib::Pointlist< L, P, V, S >::is_closed  )  const [inline, inherited]
 

It's considered a closed loop if the first and last point are the same.

Definition at line 88 of file pointlist.H.

Referenced by mlib::Pointlist< L, P, V, S >::self_intersects().

bool ARRAY< P >::is_indexing  )  const [inline, inherited]
 

Definition at line 219 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE bool mlib::Pointlist< L, P, V, S >::is_straight double  len_scale = 1e-5  )  const [inherited]
 

Returns true if the points fall in a straight line.

len_scale * length() gives the threshold for how close points have to be to the proposed straight line to be accepted.

Definition at line 20 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::_partial_length, mlib::Pointlist< L, P, V, S >::length(), ARRAY< T >::num(), ARRAY< P >::num(), and mlib::Pointlist< L, P, V, S >::pt().

P & ARRAY< P >::last  )  const [inline, inherited]
 

Definition at line 194 of file support.H.

Referenced by mlib::Point3list< L, M, P, V, S >::fix_endpoints(), mlib::Point2list< L, P, V, S >::fix_endpoints(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::is_closed(), and mlib::Pointlist< L, P, V, S >::resample().

template<class L, class P, class V, class S>
double mlib::Pointlist< L, P, V, S >::length  )  const [inline, inherited]
 

Definition at line 168 of file pointlist.H.

Referenced by mlib::Pointlist< L, P, V, S >::avg_dist_to_seg(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::avg_len(), mlib::Pointlist< L, P, V, S >::closest(), mlib::Wpt_list::get_plane(), mlib::Pointlist< L, P, V, S >::invert(), mlib::Pointlist< L, P, V, S >::is_straight(), LINE3D::length(), GESTURE::length(), mlib::Point2list< L, P, V, S >::ray_intersect(), and GESTURE::winding().

template<class L, class P, class V, class S>
P::value_type mlib::Pointlist< L, P, V, S >::max_val int  i  )  const [inherited]
 

Returns the max value, over the polyline, for the given component i.

Components are numbered starting at 0 and are in the same order that they are accessed throught the subscripting operator for the polyline's point type.

Definition at line 271 of file pointlist.C.

References ARRAY< P >::empty(), err_msg(), max(), ARRAY< P >::num(), and mlib::Pointlist< L, P, V, S >::pt().

template<class L, class P, class V, class S>
P::value_type mlib::Pointlist< L, P, V, S >::min_val int  i  )  const [inherited]
 

Returns the min value, over the polyline, for the given component i.

Components are numbered starting at 0 and are in the same order that they are accessed throught the subscripting operator for the polyline's point type.

Definition at line 251 of file pointlist.C.

References ARRAY< P >::empty(), err_msg(), min(), ARRAY< P >::num(), and mlib::Pointlist< L, P, V, S >::pt().

template<class L, class P, class V, class S>
MLIB_INLINE int mlib::Pointlist< L, P, V, S >::nearest_point const P &  p  )  const [inherited]
 

Finds the index of the nearest point in the point list to point p.

Definition at line 85 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::dist(), and ARRAY< P >::num().

int ARRAY< P >::num  )  const [inline, inherited]
 

Definition at line 184 of file support.H.

Referenced by mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::average(), mlib::Pointlist< L, P, V, S >::avg_dist_to_seg(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::avg_len(), mlib::Pointlist< L, P, V, S >::clone_piece(), mlib::Pointlist< L, P, V, S >::closest(), mlib::Point2list< L, P, V, S >::contains(), mlib::Pointlist< L, P, V, S >::dist_to_seg(), mlib::Point3list< L, M, P, V, S >::fix_endpoints(), mlib::Point2list< L, P, V, S >::fix_endpoints(), mlib::Pointlist< L, P, V, S >::get_tangent(), mlib::Pointlist< L, P, V, S >::interpolate_length(), mlib::Point2list< L, P, V, S >::intersects_line(), mlib::Point2list< L, P, V, S >::intersects_seg(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::is_closed(), mlib::Pointlist< L, P, V, S >::is_straight(), mlib::Pointlist< L, P, V, S >::max_val(), mlib::Pointlist< L, P, V, S >::min_val(), mlib::Pointlist< L, P, V, S >::nearest_point(), mlib::Pointlist< L, P, V, S >::prepend(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), project_to_plane(), mlib::Point2list< L, P, V, S >::ray_intersect(), mlib::Pointlist< L, P, V, S >::self_intersects(), mlib::Pointlist< L, P, V, S >::spread(), mlib::Pointlist< L, P, V, S >::sum(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::tan(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::translate(), mlib::Pointlist< L, P, V, S >::update_length(), mlib::Point3list< L, M, P, V, S >::winding_number(), mlib::Point2list< L, P, V, S >::winding_number(), and mlib::Point3list< L, M, P, V, S >::xform().

ARRAY<P >& ARRAY< P >::operator+= CARRAY< P > &  b  )  [inline, inherited]
 

Definition at line 431 of file support.H.

void ARRAY< P >::operator+= const P &  el  )  [inline, inherited]
 

Definition at line 298 of file support.H.

Referenced by mlib::Pointlist< L, P, V, S >::append().

void ARRAY< P >::operator-= CARRAY< P > &  l  )  [inline, inherited]
 

Definition at line 451 of file support.H.

bool ARRAY< P >::operator-= const P &  el  )  [inline, inherited]
 

Definition at line 352 of file support.H.

P & ARRAY< P >::operator[] int  j  )  const [inline, inherited]
 

Definition at line 190 of file support.H.

template<class L, class P, class V, class S>
double mlib::Pointlist< L, P, V, S >::partial_length int  i  )  const [inline, inherited]
 

Net length along the polyline at vertex i.

Definition at line 164 of file pointlist.H.

mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::Point2list const ARRAY< XYpt > &  p  )  [inline, inherited]
 

Construct a list using the passed in array of points.

Definition at line 207 of file point2.H.

mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::Point2list int  m = 16  )  [inline, inherited]
 

Construct a list with no points but space for m points.

Definition at line 204 of file point2.H.

P ARRAY< P >::pop  )  [inline, inherited]
 

Definition at line 357 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE void mlib::Pointlist< L, P, V, S >::prepend Pointlist< L, P, V, S > *  poly  )  [inherited]
 

Prepends all the points in poly onto the list.

Definition at line 552 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::clear(), and ARRAY< P >::num().

void mlib::XYpt_list::project_to_plane CWplane P,
Wpt_list pts
const [inline]
 

Definition at line 638 of file points.H.

References ARRAY< P >::_array, ARRAY< P >::_num, mlib::Pointlist< L, P, V, S >::clear(), ARRAY< P >::empty(), ARRAY< P >::num(), ARRAY< T >::realloc(), and mlib::Pointlist< L, P, V, S >::update_length().

template<class L, class P, class V, class S>
P mlib::Pointlist< L, P, V, S >::pt int  i  )  const [inline, inherited]
 

Get the ith point in the list.

Definition at line 56 of file pointlist.H.

Referenced by mlib::Point2list< L, P, V, S >::intersects_line(), mlib::Pointlist< L, P, V, S >::is_straight(), mlib::Pointlist< L, P, V, S >::max_val(), mlib::Pointlist< L, P, V, S >::min_val(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::seg(), mlib::Point3list< L, M, P, V, S >::winding_number(), and mlib::Point2list< L, P, V, S >::winding_number().

bool ARRAY< P >::pull_element const P &  p  )  [inline, inherited]
 

Definition at line 383 of file support.H.

bool ARRAY< P >::pull_index int  k  )  [inline, inherited]
 

Definition at line 366 of file support.H.

void ARRAY< P >::push const P &  p  )  [inline, inherited]
 

Definition at line 309 of file support.H.

XYpt mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::ray_intersect const XYpt p,
const XYvec d,
int  k0,
int  k1
const [inherited]
 

returns the intersection of the ray with a subpart (k0 through k1 inclusive) of the poly line. if it doesn't intersect, returns the nearest point to the ray on the polyline part

bool mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::ray_intersect const XYpt p,
const XYvec d,
XYpt_list hit,
int  loop = 0
const [inherited]
 

bool mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::ray_intersect const XYpt p,
const XYvec d,
XYpt hit,
int  loop = 0
const [inherited]
 

virtual void ARRAY< P >::realloc int  new_max = 0  )  [inline, virtual, inherited]
 

Definition at line 252 of file support.H.

bool ARRAY< P >::rem const P &  p  )  [inline, inherited]
 

Definition at line 353 of file support.H.

bool ARRAY< P >::remove int  k  )  [inline, inherited]
 

Definition at line 333 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE void mlib::Pointlist< L, P, V, S >::resample int  num_segs  )  [inherited]
 

Resample with the desired number of segments:.

Definition at line 486 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::interpolate(), ARRAY< P >::last(), and mlib::Pointlist< L, P, V, S >::update_length().

virtual void ARRAY< P >::reverse  )  [inline, virtual, inherited]
 

Definition at line 457 of file support.H.

template<class L, class P, class V, class S>
S mlib::Pointlist< L, P, V, S >::seg int  i  )  const [inline, inherited]
 

Get the ith segment in the list.

Definition at line 65 of file pointlist.H.

Referenced by mlib::Pointlist< L, P, V, S >::get_tangent(), mlib::Pointlist< L, P, V, S >::interpolate(), mlib::Point2list< L, P, V, S >::intersects_seg(), and mlib::Pointlist< L, P, V, S >::self_intersects().

template<class L, class P, class V, class S>
double mlib::Pointlist< L, P, V, S >::segment_length int  i  )  const [inline, inherited]
 

Get the length of the ith segment in the list.

Definition at line 62 of file pointlist.H.

Referenced by mlib::Pointlist< L, P, V, S >::update_length().

template<class L, class P, class V, class S>
MLIB_INLINE bool mlib::Pointlist< L, P, V, S >::self_intersects  )  const [inherited]
 

Does O(n^2) check to see if any segment of the polyline intersects any other, not counting adjacent segments of course.

Definition at line 63 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::is_closed(), j, ARRAY< P >::num(), and mlib::Pointlist< L, P, V, S >::seg().

Referenced by GESTURE::self_intersects().

virtual void ARRAY< P >::set_index const P &  ,
int 
const [inline, protected, virtual, inherited]
 

Definition at line 136 of file support.H.

void ARRAY< P >::set_unique  )  [inline, inherited]
 

Definition at line 187 of file support.H.

template<class L, class P, class V, class S>
virtual void mlib::Pointlist< L, P, V, S >::shift int  p  )  [inline, virtual, inherited]
 

Reimplemented from ARRAY< P >.

Definition at line 235 of file pointlist.H.

virtual void ARRAY< P >::sort compare_func_t  compare  )  [inline, virtual, inherited]
 

Definition at line 468 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE double mlib::Pointlist< L, P, V, S >::spread  )  const [inherited]
 

Max distance of any point to average().

Definition at line 227 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::average(), ARRAY< P >::empty(), max(), and ARRAY< P >::num().

Referenced by GESTURE::spread().

template<class L, class P, class V, class S>
MLIB_INLINE P mlib::Pointlist< L, P, V, S >::sum  )  const [inherited]
 

Computes the sum of all the points in the list.

Definition at line 191 of file pointlist.C.

References ARRAY< P >::num().

Referenced by mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::average(), and Bvert_list::sum().

template<class L, class P, class V, class S>
V mlib::Pointlist< L, P, V, S >::tan int  i  )  const [inline, inherited]
 

Returns a "tangent" direction at each vertex.

At the endpoints it is the direction of the ending segment. At internal vertices it is the average of the two segment directions.

Definition at line 72 of file pointlist.H.

Referenced by LINE3D::tangent().

template<class L, class P, class V, class S>
void mlib::Pointlist< L, P, V, S >::translate const V &  vec  )  [inline, inherited]
 

Translate all points in polyline by given vector.

Parameters:
[in] vec Vector that represents translation to be applied.

Definition at line 205 of file pointlist.H.

Referenced by mlib::Point2list< L, P, V, S >::fix_endpoints().

virtual void ARRAY< P >::truncate int  n  )  [inline, virtual, inherited]
 

Definition at line 234 of file support.H.

template<class L, class P, class V, class S>
MLIB_INLINE void mlib::Pointlist< L, P, V, S >::update_length  )  [inherited]
 

This must be called before the interpolation routines can work properly.

Definition at line 288 of file pointlist.C.

References mlib::Pointlist< L, P, V, S >::_partial_length, ARRAY< T >::clear(), ERR_LEV_SPAM, err_mesg(), ARRAY< T >::last(), ARRAY< P >::num(), ARRAY< T >::realloc(), and mlib::Pointlist< L, P, V, S >::segment_length().

Referenced by GESTURE::add(), mlib::Point2list< L, P, V, S >::fix_endpoints(), get_section(), mlib::NDCpt_list::NDCpt_list(), mlib::PIXEL_list::operator=(), mlib::NDCpt_list::operator=(), mlib::PIXEL_list::PIXEL_list(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::Pointlist(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), project_to_plane(), Bvert_list::pts(), mlib::Pointlist< L, P, V, S >::resample(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::shift(), mlib::Wpt_list::Wpt_list(), Bvert_list::wpts(), and mlib::Point3list< L, M, P, V, S >::xform().

bool ARRAY< P >::valid_index int  k  )  const [inline, inherited]
 

Definition at line 186 of file support.H.

Referenced by mlib::Pointlist< L, P, V, S >::clone_piece().

template<class L, class P, class V, class S>
V mlib::Pointlist< L, P, V, S >::vec int  i  )  const [inline, inherited]
 

Get the vector from the ith point in the list to the (i + 1)th point in the list.

Definition at line 59 of file pointlist.H.

Referenced by mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::segment_length(), and mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::tan().

double mlib::Point2list< XYpt_list , XYpt , XYvec , XYline >::winding_number const XYpt  )  const [inherited]
 

Returns the winding number.

I.e.,computes the number of times the polyline winds around the given point in the CCW direction. For a closed polyline the result is an integer: e.g. +1 if it winds around once CCW, -1 if it winds once clockwise, and 0 if the given point is outside the projected polyline.


Member Data Documentation

P * ARRAY< P >::_array [protected, inherited]
 

Definition at line 121 of file support.H.

Referenced by mlib::Wpt_list::closest_vertex(), mlib::Wpt_list::get_best_fit_plane(), mlib::Wpt_list::get_plane(), mlib::Wpt_list::project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), and project_to_plane().

bool ARRAY< P >::_do_index [protected, inherited]
 

Definition at line 125 of file support.H.

int ARRAY< P >::_max [protected, inherited]
 

Definition at line 123 of file support.H.

int ARRAY< P >::_num [protected, inherited]
 

Definition at line 122 of file support.H.

Referenced by mlib::Wpt_list::closest_vertex(), mlib::Wpt_list::get_best_fit_plane(), mlib::Wpt_list::get_plane(), mlib::Wpt_list::project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), and project_to_plane().

template<class L, class P, class V, class S>
ARRAY<double> mlib::Pointlist< L, P, V, S >::_partial_length [protected, inherited]
 

Definition at line 35 of file pointlist.H.

Referenced by mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::clear(), mlib::Wpt_list::get_plane(), mlib::Pointlist< L, P, V, S >::interpolate_length(), mlib::Pointlist< L, P, V, S >::invert(), mlib::Pointlist< L, P, V, S >::is_straight(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::length(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::partial_length(), and mlib::Pointlist< L, P, V, S >::update_length().

bool ARRAY< P >::_unique [protected, inherited]
 

Definition at line 124 of file support.H.


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:48:17 2006 for jot by  doxygen 1.4.4