Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types

mln::p_line2d Class Reference
[Basic types]

2D discrete line of points. More...

#include <p_line2d.hh>

Inheritance diagram for mln::p_line2d:
Inheritance graph

List of all members.

Public Types

typedef p_indexed_bkd_piter
< self_
bkd_piter
 Backward Site_Iterator associated type.
typedef Site_Set< void > category
typedef point2d element
 Element associated type.
typedef p_line2d exact_t
typedef p_indexed_fwd_piter
< self_
fwd_piter
 Forward Site_Iterator associated type.
typedef p_indexed_fwd_piter
< self_
piter
 Site_Iterator associated type.
typedef p_indexed_psite< self_psite
 Psite associated type.
typedef const box2dq_box
 Box (qualified) associated type.
typedef subject< point2d >::ret site
 Site associated type.

Public Member Functions

const box2dbbox () const
 Give the exact bounding box.
const point2dbegin () const
 Give the point that begins the line.
const point2dend () const
 Give the point that ends the line.
bool has (const util::index &i) const
 Test if index i belongs to this point set.
bool has (const psite &p) const
 Test if p belongs to this point set.
bool is_empty () const
 Test if the site set is empty.
bool is_valid () const
 Test if this line is valid, i.e., initialized.
std::size_t memory_size () const
 Return the size of this site set in memory.
unsigned nsites () const
 Give the number of points.
const point2doperator[] (unsigned i) const
 Return the i-th point of the line.
 p_line2d (const point2d &beg, const point2d &end, bool is_end_excluded=false)
 Constructor from point beg to point end.
 p_line2d ()
 Constructor without argument.
const std::vector< point2d > & std_vector () const
 Return the corresponding std::vector of points.
algebra::vec< 2, float > to_vec () const

Protected Member Functions

void compute_ (const point2d &beg, const point2d &end, bool is_end_excluded)

Protected Attributes

p_array< point2darr_
box2d bb_

Private Types

typedef p_line2d self_

Detailed Description

2D discrete line of points.

It is based on p_array.


Member Typedef Documentation

Backward Site_Iterator associated type.

typedef Site_Set<void> mln::Site_Set< p_line2d >::category [inherited]

Reimplemented from mln::Object< p_line2d >.

Element associated type.

typedef p_line2d mln::Object< p_line2d >::exact_t [inherited]

Forward Site_Iterator associated type.

Site_Iterator associated type.

Psite associated type.

typedef const box2d& mln::p_line2d::q_box

Box (qualified) associated type.

typedef p_line2d mln::p_line2d::self_ [private]

Site associated type.


Constructor & Destructor Documentation

mln::p_line2d::p_line2d (  )  [inline]

Constructor without argument.

References is_valid().

mln::p_line2d::p_line2d ( const point2d beg,
const point2d end,
bool  is_end_excluded = false 
) [inline]

Constructor from point beg to point end.

References compute_(), and is_valid().


Member Function Documentation

const box2d & mln::p_line2d::bbox (  )  const [inline]

Give the exact bounding box.

References bb_, and is_valid().

const point2d & mln::p_line2d::begin (  )  const [inline]

Give the point that begins the line.

References arr_, and is_valid().

Referenced by compute_(), mln::debug::draw_graph(), mln::trait::set_precise_unary_< op::ord, p_line2d >::strict(), and to_vec().

void mln::p_line2d::compute_ ( const point2d beg,
const point2d end,
bool  is_end_excluded 
) [inline, protected]
const point2d & mln::p_line2d::end (  )  const [inline]
bool mln::p_line2d::has ( const psite p  )  const [inline]
bool mln::p_line2d::has ( const util::index i  )  const [inline]

Test if index i belongs to this point set.

References nsites().

bool mln::internal::site_set_base_< point2d , p_line2d >::is_empty (  )  const [inherited]

Test if the site set is empty.

This final method dispatches to is_empty_ whose default implementation relies on the 'nsites' method.

bool mln::p_line2d::is_valid (  )  const [inline]

Test if this line is valid, i.e., initialized.

References arr_, bb_, mln::implies(), mln::internal::site_set_base_< P, E >::is_empty(), and mln::box< P >::is_valid().

Referenced by bbox(), begin(), end(), and p_line2d().

std::size_t mln::p_line2d::memory_size (  )  const [inline]

Return the size of this site set in memory.

References arr_, and mln::p_array< P >::memory_size().

unsigned mln::p_line2d::nsites (  )  const [inline]

Give the number of points.

References arr_, and mln::p_array< P >::nsites().

Referenced by end(), has(), and operator[]().

const point2d & mln::p_line2d::operator[] ( unsigned  i  )  const [inline]

Return the i-th point of the line.

References arr_, and nsites().

const std::vector< point2d > & mln::p_line2d::std_vector (  )  const [inline]

Return the corresponding std::vector of points.

References arr_, and mln::p_array< P >::std_vector().

algebra::vec< 2, float > mln::p_line2d::to_vec (  )  const [inline]

References begin(), and end().


Member Data Documentation

Referenced by bbox(), compute_(), and is_valid().