Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Private Attributes | List of all members
PointList< N, Type > Class Template Reference

Detailed Description

template<uint N, class Type = Real>
class PointList< N, Type >

Contiguously stored array of n-d points.

This is a thin wrapper around a std::vector of SVector elements which adds some member functions which are often needed, such as a euclidian-distance based unique(), bounds() and XML/binary data i/o.

Very old.

See Also
PointGrid, Transformation, SVector

#include <point.h>

Public Member Functions

 PointList ()
 default construction
 PointList (PointList< N, Type > &&src)
 move construction
 PointList (const PointList< N, Type > &)=default
 copy construction
 PointList (uint n)
 sized construction
template<class AType >
 PointList (const PointList< N, AType > &a)
 conversion construction
template<class Iterator >
 PointList (Iterator first, Iterator last)
 range initialization
template<class AType >
 PointList (const PointList< N, AType > &a, const Indices &idx)
 construct by reordering another list
PointList< N, Type > & operator= (PointList< N, Type > &&src)
 move assignment
PointList< N, Type > & operator= (const PointList< N, Type > &src)
 copy assignment
PointList< N, Type > & operator= (const point_type &src)
 fill list with one value
const_iterator begin () const
 const access
iterator begin ()
const_iterator end () const
 const access
iterator end ()
const_reference operator[] (uint i) const
 subscript access
reference operator[] (uint i)
 subscript access
PointList< N, Type > operator[] (const Indices &idx) const
 construct a subset
const_reference operator() (uint i) const
 subscript access
reference operator() (uint i)
 subscript access
const_reference front () const
 first object
reference front ()
 first object
const_reference back () const
 last object
reference back ()
 last object
const_reference back (uint i) const
 indexed from behind
reference back (uint i)
 indexed from behind
const Type * pointer () const
 pointer to first value of first point
Type * pointer ()
 pointer to first value of first point
uint size () const
 vector length
uint capacity () const
 storage capacity
bool empty () const
 check for content
void resize (uint n)
 change length
void resize (uint n, const value_type &t)
 change length
void reserve (uint n)
 reserve storage
uint push_back (const value_type &x)
 append and return index of appended point
template<class InputIterator >
void insert (iterator pos, InputIterator a, InputIterator b)
 range insert
iterator insert (iterator pos, const_reference a)
 item insert
iterator erase (iterator pos)
 erase element
iterator erase (iterator from, iterator to)
 erase range
void clear ()
 clear storage
Real length () const
 compute sum of segment lengths
uint append (const PointList< N > &a)
 append, return new size
void pop_back ()
 remove last element
void unique (Real tol=gmepsilon)
 remove consecutive duplicates
void operator*= (Real f)
void operator/= (Real f)
const PointList< N > & operator+= (const PointList< N > &a)
const PointList< N > & operator-= (const PointList< N > &a)
PointList< N > operator+ (const PointList< N > &a) const
PointList< N > operator- (const PointList< N > &a) const
template<uint C>
uint cmin () const
 find index of point with smallest c coordinate
template<uint C>
uint cmax () const
 find index of point with largest c coordinate
template<typename BType >
void bounds (SVector< N, BType > &plo, SVector< N, BType > &phi, bool initBounds=true) const
 determine bounding box
void zero ()
 zero out everything
void swap (PointList< N, Type > &other)
 swap contents with other point list
XmlElement toXml () const
 convert to xml representation
void fromXml (const XmlElement &xe)
 read from xml representation

Private Attributes

container data
 dynamic storage

The documentation for this class was generated from the following files: