Instigate Open Source Documentation

instigate::geometry::line Class Reference

Class for line segment representation. More...

#include <line.hpp>

List of all members.

Public Types

Point type of the line



typedef point point_type

Public Member Functions

Special member functions



 ~line () throw ()
 Destructor.
 line () throw ()
 Default constructor.
 line (coordinate_type a, coordinate_type b, coordinate_type c, coordinate_type d) throw ()
 Create line with given coordinates.
 line (const line &l) throw ()
 Copy constructor.
template<typename L >
 line (const L &l)
 Copy constructor from any other line segmant.
lineoperator= (const line &l) throw ()
 Template assignment operator.
template<typename L >
lineoperator= (const L &l)
 Template assignment operator.

Source, target coordinates of the line segment



typedef point::coordinate_type coordinate_type
void set_source_x (const coordinate_type &v) throw ()
 Sets the source x coordinate of the line segment.
void set_source_y (const coordinate_type &v) throw ()
 Sets the source y coordinate of the line segment.
void set_target_x (const coordinate_type &v) throw ()
 Sets the target x coordinate of the line segment.
void set_target_y (const coordinate_type &v) throw ()
 Sets the target y coordinate of the line segment.
const coordinate_type & get_source_x () const throw ()
 Gets the source x coordinate of the line segment.
const coordinate_type & get_source_y () const throw ()
 Gets the source y coordinate of the line segment.
const coordinate_type & get_target_x () const throw ()
 Gets the target x coordinate of the line segment.
const coordinate_type & get_target_y () const throw ()
 Gets the target y coordinate of the line segment.

Detailed Description

Class for line segment representation.

This class is a model of geometry::concept::line


Constructor & Destructor Documentation

instigate::geometry::line::line ( coordinate_type  a,
coordinate_type  b,
coordinate_type  c,
coordinate_type  d 
) throw ()

Create line with given coordinates.

Parameters:
a is the source x coordinate
b is the source y coordinate
c is the target x coordinate
d is the target y coordinate
instigate::geometry::line::line ( const line l  )  throw ()

Copy constructor.

Parameters:
l - object to copy from
template<typename L >
instigate::geometry::line::line ( const L &  l  )  [inline]

Copy constructor from any other line segmant.

Parameters:
l - another line segment object
Precondition:
L must be a model of concept geometry::concept::line

References CHECK.


Member Function Documentation

const coordinate_type& instigate::geometry::line::get_source_x (  )  const throw ()

Gets the source x coordinate of the line segment.

Returns:
the source x coordinate of the line segment
Complexity:
O(1).

Referenced by operator=().

const coordinate_type& instigate::geometry::line::get_source_y (  )  const throw ()

Gets the source y coordinate of the line segment.

Returns:
the source y coordinate of the line segment
Complexity:
O(1).

Referenced by operator=().

const coordinate_type& instigate::geometry::line::get_target_x (  )  const throw ()

Gets the target x coordinate of the line segment.

Returns:
the target x coordinate of the line segment
Complexity:
O(1).

Referenced by operator=().

const coordinate_type& instigate::geometry::line::get_target_y (  )  const throw ()

Gets the target y coordinate of the line segment.

Returns:
the target y coordinate of the line segment
Complexity:
O(1).

Referenced by operator=().

template<typename L >
line& instigate::geometry::line::operator= ( const L &  l  )  [inline]

Template assignment operator.

Parameters:
l - object to copy from
Precondition:
The type L must be a model of concept geometry::concept::line

References CHECK, get_source_x(), get_source_y(), get_target_x(), and get_target_y().

line& instigate::geometry::line::operator= ( const line l  )  throw ()

Template assignment operator.

Parameters:
l - object to copy from
void instigate::geometry::line::set_source_x ( const coordinate_type &  v  )  throw ()

Sets the source x coordinate of the line segment.

Parameters:
[in] v - the value for the source x coordinate
Complexity:
O(1).
void instigate::geometry::line::set_source_y ( const coordinate_type &  v  )  throw ()

Sets the source y coordinate of the line segment.

Parameters:
[in] v - the value for the source y coordinate
Complexity:
O(1).
void instigate::geometry::line::set_target_x ( const coordinate_type &  v  )  throw ()

Sets the target x coordinate of the line segment.

Parameters:
[in] v - the value for target x coordinate
Complexity:
O(1).
void instigate::geometry::line::set_target_y ( const coordinate_type &  v  )  throw ()

Sets the target y coordinate of the line segment.

Parameters:
[in] v - the value for target y coordinate
Complexity:
O(1).

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


© Instigate CJSC, Open Source