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

mlib::Wpt_list Class Reference
["World" Coordinate System]

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

#include <points.H>

Inheritance diagram for mlib::Wpt_list:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Point3list (int max=16)
 Default constructor. Creates an empty list with space for max points.
 Point3list (const ARRAY< Wpt > &p)
 Constructor that creates a list containing the points in ARRAY p.
 Point3list (const ARRAY< Wpt > &p, const Wtransf &t)
 Constructor that creates a list containing the points in ARRAY p transformed by matrix t.
double winding_number (const Wpt &o, const Wvec &n) const
 Returns the winding number WRT the given point and direction.
void xform (const Wtransf &t)
 Multiply the points by the transform.
bool fix_endpoints (Wpta, Wptb)
 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 contains (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)
Constructors
 Wpt_list (int max=0)
 Wpt_list (const Point3list< Wpt_list, Wtransf, Wpt, Wvec, Wline > &p)
 Wpt_list (const Point3list< Wpt_list, Wtransf, Wpt, Wvec, Wline > &p, CWtransf &t)
Projection Functions
bool project (XYpt_list &ret) const
 Project to screen coords, provided all Wpts lie in the view frustum.
bool project (PIXEL_list &ret) const
 Project to screen coords, provided all Wpts lie in the view frustum.
Nearest Point Functions
int closest_vertex (CPIXEL &p) const
 Returns index of the *vertex* of the polyline that is closest to the given screen-space point (distance measured in PIXELs). Skips vertices that lie outside the view frustum. Returns -1 if no vertices lie in the frustum.
Best-Fit Plane Functions
bool get_best_fit_plane (Wplane &P) const
 Return the best-fit plane.
bool get_plane (Wplane &P, double len_scale=1e-3) const
 Return the best-fit plane if the fit is good. Parameter 'len_scale' is multiplied by the length of the polyline to yield a threshold. The fit is considered good if every point lies within the threshold distance from the plane.
bool is_planar (double len_scale=1e-3) const
 Return true if get_plane succeeds with the given threshold.
bool get_plane_normal (Wvec &n)
 Convenience: compute the best-fit plane and return its normal.

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

Related Functions

(Note that these are not member functions.)

Overloaded Arithmetic Operators
Wpt_list operator * (CWtransf &x, CWpt_list &pts)
 Multiplies a transformation matrix by every point in the list.
Wpt_list operator * (CWpt_list &pts, double t)
 Multiplies all the points in the list by a scalar constant.
Wpt_list operator+ (CWpt_list &pts1, CWpt_list &pts2)
 Adds all the points in one list to the corresponding points in another list. The two lists must contain the same number of points.

Detailed Description

A list of points in World coordinates.

Definition at line 372 of file points.H.


Constructor & Destructor Documentation

mlib::Wpt_list::Wpt_list int  max = 0  )  [inline]
 

Definition at line 379 of file points.H.

mlib::Wpt_list::Wpt_list const Point3list< Wpt_list, Wtransf, Wpt, Wvec, Wline > &  p  )  [inline]
 

Definition at line 382 of file points.H.

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

mlib::Wpt_list::Wpt_list const Point3list< Wpt_list, Wtransf, Wpt, Wvec, Wline > &  p,
CWtransf t
[inline]
 

Definition at line 391 of file points.H.

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


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(), 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(), project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), mlib::XYpt_list::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().

int mlib::Wpt_list::closest_vertex CPIXEL p  )  const
 

Returns index of the *vertex* of the polyline that is closest to the given screen-space point (distance measured in PIXELs). Skips vertices that lie outside the view frustum. Returns -1 if no vertices lie in the frustum.

Definition at line 596 of file points.C.

References ARRAY< P >::_array, and ARRAY< P >::_num.

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.

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(), project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), mlib::XYpt_list::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().

bool mlib::Point3list< Wpt_list , Wtransf , Wpt , Wvec , Wline >::fix_endpoints Wpt   a,
Wpt   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

bool mlib::Wpt_list::get_best_fit_plane Wplane P  )  const
 

Return the best-fit plane.

Definition at line 620 of file points.C.

References ARRAY< P >::_array, ARRAY< P >::_num, mlib::Pointlist< L, P, V, S >::average(), mlib::Vec3< V >::is_null(), j, and mlib::Vec3< V >::normalized().

Referenced by get_plane().

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

Definition at line 275 of file support.H.

bool mlib::Wpt_list::get_plane Wplane P,
double  len_scale = 1e-3
const
 

Return the best-fit plane if the fit is good. Parameter 'len_scale' is multiplied by the length of the polyline to yield a threshold. The fit is considered good if every point lies within the threshold distance from the plane.

Definition at line 657 of file points.C.

References ARRAY< P >::_array, ARRAY< P >::_num, mlib::Pointlist< L, P, V, S >::_partial_length, mlib::Plane< PLANE, P, V, L >::dist(), get_best_fit_plane(), mlib::Pointlist< L, P, V, S >::length(), and ARRAY< T >::num().

Referenced by get_plane_normal(), and is_planar().

bool mlib::Wpt_list::get_plane_normal Wvec n  )  [inline]
 

Convenience: compute the best-fit plane and return its normal.

Definition at line 445 of file points.H.

References get_plane(), and mlib::Plane< PLANE, P, V, L >::normal().

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().

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.

bool mlib::Wpt_list::is_planar double  len_scale = 1e-3  )  const [inline]
 

Return true if get_plane succeeds with the given threshold.

Definition at line 438 of file points.H.

References get_plane(), and mlib::Plane< PLANE, P, V, L >::is_valid().

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(), 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(), mlib::XYpt_list::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::Point3list< Wpt_list , Wtransf , Wpt , Wvec , Wline >::Point3list const ARRAY< Wpt > &  p,
const Wtransf t
[inline, inherited]
 

Constructor that creates a list containing the points in ARRAY p transformed by matrix t.

Definition at line 215 of file point3.H.

References mlib::Point3list< L, M, P, V, S >::xform().

mlib::Point3list< Wpt_list , Wtransf , Wpt , Wvec , Wline >::Point3list const ARRAY< Wpt > &  p  )  [inline, inherited]
 

Constructor that creates a list containing the points in ARRAY p.

Definition at line 211 of file point3.H.

mlib::Point3list< Wpt_list , Wtransf , Wpt , Wvec , Wline >::Point3list int  max = 16  )  [inline, inherited]
 

Default constructor. Creates an empty list with space for max points.

Definition at line 207 of file point3.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().

bool mlib::Wpt_list::project PIXEL_list ret  )  const
 

Project to screen coords, provided all Wpts lie in the view frustum.

Definition at line 583 of file points.C.

References project().

bool mlib::Wpt_list::project XYpt_list ret  )  const
 

Project to screen coords, provided all Wpts lie in the view frustum.

Definition at line 553 of file points.C.

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

Referenced by project().

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.

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(), mlib::XYpt_list::project_to_plane(), Bvert_list::pts(), mlib::Pointlist< L, P, V, S >::resample(), mlib::Pointlist< NDCpt_list, NDCpt, NDCvec, NDCline >::shift(), 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::Point3list< Wpt_list , Wtransf , Wpt , Wvec , Wline >::winding_number const Wpt o,
const Wvec n
const [inherited]
 

Returns the winding number WRT the given point and direction.

I.e., projects the polyline to the plane containing point 'o' and perpendicular to direction 'n', then computes the number of times the result winds around o 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 o is outside the projected polyline.

void mlib::Point3list< Wpt_list , Wtransf , Wpt , Wvec , Wline >::xform const Wtransf t  )  [inherited]
 

Multiply the points by the transform.


Friends And Related Function Documentation

Wpt_list operator * CWpt_list pts,
double  t
[related]
 

Multiplies all the points in the list by a scalar constant.

Definition at line 473 of file points.H.

Wpt_list operator * CWtransf x,
CWpt_list pts
[related]
 

Multiplies a transformation matrix by every point in the list.

Definition at line 463 of file points.H.

Wpt_list operator+ CWpt_list pts1,
CWpt_list pts2
[related]
 

Adds all the points in one list to the corresponding points in another list. The two lists must contain the same number of points.

Definition at line 484 of file points.H.


Member Data Documentation

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

Definition at line 121 of file support.H.

Referenced by closest_vertex(), get_best_fit_plane(), get_plane(), project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), and mlib::XYpt_list::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 closest_vertex(), get_best_fit_plane(), get_plane(), project(), mlib::PIXEL_list::project_to_plane(), mlib::NDCpt_list::project_to_plane(), and mlib::XYpt_list::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(), 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 files:
Generated on Mon Sep 18 11:48:15 2006 for jot by  doxygen 1.4.4