Instigate Open Source Documentation

instigate::geometry Namespace Reference

Namespaces

namespace  implementation
 

Contains implementation details of geometry algorithms.


Classes

class  line
 Class for line segment representation. More...
class  point
 2-dimensional point with double precision coordinates More...
class  rectangle
 Rectangle in 2-dimensional plane, with edges parallel to axes. More...

Functions

template<typename P , typename C >
void set_x (P &p, const C &c)
 Set x coordinate of a point to given value.
template<typename P , typename C >
void set_y (P &p, const C &c)
 Set y coordinate of a point to given value.
template<typename R , typename P >
void set_right (R &r, const P &x)
 set right coordinate of the rectangle
template<typename R , typename P >
void set_left (R &r, const P &x)
 set left coordinate of the rectangle
template<typename R >
bool is_intersect (const R &a, const R &b)
template<typename R , typename P >
void get_first_nearest_point (const R &a, const R &b, P &p)
template<typename R , typename P >
void get_second_nearest_point (const R &a, const R &b, P &p)
template<typename R , typename P >
void set_bottom (R &r, const P &x)
 set bottom coordinate of the rectangle
template<typename R , typename P >
void set_top (R &r, const P &x)
 set top coordinate of the rectangle
template<typename R , typename P >
get_right (R &r)
 get right coordinate of the rectangle
template<typename R , typename P >
get_left (R &r)
 get left coordinate of the rectangle
template<typename R , typename P >
get_bottom (R &r)
 get bottom coordinate of the rectangle
template<typename R , typename P >
get_top (R &r)
 get top coordinate of the rectangle
template<typename L , typename C >
void set_source_x (L &l, const C &x)
 Set source x coordinate of line to given value.
template<typename L , typename C >
void set_source_y (L &l, const C &y)
 Set source y coordinate of line to given value.
template<typename L , typename C >
void set_target_x (L &l, const C &x)
 Set target x coordinate of line to given value.
template<typename L , typename C >
void set_target_y (L &l, const C &y)
 Set target y coordinate of line to given value.
template<typename L , typename P >
get_source_x (L &l)
 get source x coordinate of the line
template<typename L , typename P >
get_source_y (L &l)
 get source y coordinate of the line
template<typename L , typename P >
get_target_x (L &l)
 get target x coordinate of the line
template<typename L , typename P >
get_target_y (L &l)
 get source y coordinate of the line
template<typename L , typename P >
void set_source (L &l, const P &v)
 Set source point of the line to given value.

Detailed Description

Library of geometric data structures and algorithms.


Function Documentation

template<typename R , typename P >
P instigate::geometry::get_bottom ( R &  r  )  [inline]

get bottom coordinate of the rectangle

Parameters:
r - a rectangle
Returns:
The bottom coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by get_first_nearest_point(), get_second_nearest_point(), and is_intersect().

template<typename R , typename P >
void instigate::geometry::get_first_nearest_point ( const R &  a,
const R &  b,
P &  p 
) [inline]
Returns:
the nearest point of two objects placed on the first object
Parameters:
a - the first object
b - the second object
p - the first nearest coordinate on first rectangle to achive second rectangle.
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the coordinate_type of type P must be convertible to the coordinate_type of R
Complexity
Contains two calls of instigate::geometry::implemenantion::get_middle_point function.

References CHECK, get_bottom(), get_left(), instigate::geometry::implementation::get_middle_point(), get_right(), get_top(), set_x(), and set_y().

template<typename R , typename P >
P instigate::geometry::get_left ( R &  r  )  [inline]

get left coordinate of the rectangle

Parameters:
r - a rectangle
Returns:
The left coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by get_first_nearest_point(), get_second_nearest_point(), and is_intersect().

template<typename R , typename P >
P instigate::geometry::get_right ( R &  r  )  [inline]

get right coordinate of the rectangle

Parameters:
r - a rectangle
Returns:
The right coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by get_first_nearest_point(), get_second_nearest_point(), and is_intersect().

template<typename R , typename P >
void instigate::geometry::get_second_nearest_point ( const R &  a,
const R &  b,
P &  p 
) [inline]
Returns:
the nearest point of two objects placed on the second object
Parameters:
a - the first object
b - the second object
p - the second nearest coordinate on first rectangle to achive second rectangle.
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the coordinate_type of type P must be convertible to the coordinate_type of R
Complexity
Contains two calls of instigate::geometry::implemenantion::get_middle_point function.

References CHECK, get_bottom(), get_left(), instigate::geometry::implementation::get_middle_point(), get_right(), get_top(), set_x(), and set_y().

template<typename L , typename P >
P instigate::geometry::get_source_x ( L &  l  )  [inline]

get source x coordinate of the line

Parameters:
l - a line
Returns:
The source x coordinate of the line
Precondition:
the type L must be model of instigate::geometry::concept::line
the type P must be convertible to the coordinate_type of L
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename L , typename P >
P instigate::geometry::get_source_y ( L &  l  )  [inline]

get source y coordinate of the line

Parameters:
l - a line
Returns:
The source y coordinate of the line
Precondition:
the type L must be model of instigate::geometry::concept::line
the type P must be convertible to the coordinate_type of L
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename L , typename P >
P instigate::geometry::get_target_x ( L &  l  )  [inline]

get target x coordinate of the line

Parameters:
l - a line
Returns:
The target x coordinate of the line
Precondition:
the type L must be model of instigate::geometry::concept::line
the type P must be convertible to the coordinate_type of L
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename L , typename P >
P instigate::geometry::get_target_y ( L &  l  )  [inline]

get source y coordinate of the line

Parameters:
l - a line
Returns:
The source y coordinate of the line
Precondition:
the type L must be model of instigate::geometry::concept::line
the type P must be convertible to the coordinate_type of L
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename R , typename P >
P instigate::geometry::get_top ( R &  r  )  [inline]

get top coordinate of the rectangle

Parameters:
r - a rectangle
Returns:
The top coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by get_first_nearest_point(), get_second_nearest_point(), and is_intersect().

template<typename R >
bool instigate::geometry::is_intersect ( const R &  a,
const R &  b 
) [inline]
Returns:
true, if objects has intersection
Parameters:
a The first rectangle
b The second rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
Complexity
O(1)

References CHECK, get_bottom(), get_left(), get_right(), and get_top().

template<typename R , typename P >
void instigate::geometry::set_bottom ( R &  r,
const P &  x 
) [inline]

set bottom coordinate of the rectangle

Parameters:
r - a rectangle
x - a bottom coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename R , typename P >
void instigate::geometry::set_left ( R &  r,
const P &  x 
) [inline]

set left coordinate of the rectangle

Parameters:
r - a rectangle
x - a left coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename R , typename P >
void instigate::geometry::set_right ( R &  r,
const P &  x 
) [inline]

set right coordinate of the rectangle

Parameters:
r - a rectangle
x - a right coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename L , typename P >
void instigate::geometry::set_source ( L &  l,
const P &  v 
) [inline]

Set source point of the line to given value.

Parameters:
l - a line
v - a new value for the source point of l
Precondition:
the type L must be model of instigate::geometry::concept::line
the type P must be model of instigate::geometry::concept::point
Complexity
O(1)

References CHECK, CHECK_CONVERTIBILITY, set_source_x(), and set_source_y().

template<typename L , typename C >
void instigate::geometry::set_source_x ( L &  l,
const C &  x 
) [inline]

Set source x coordinate of line to given value.

Parameters:
l - a line
x - a new value for the x coordinate of l
Precondition:
the type L must be model of instigate::geometry::concept::line
the type C must be convertible to the coordinate_type of L
the type C must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by set_source().

template<typename L , typename C >
void instigate::geometry::set_source_y ( L &  l,
const C &  y 
) [inline]

Set source y coordinate of line to given value.

Parameters:
l - a line
y - a new value for the y coordinate of l
Precondition:
the type L must be model of instigate::geometry::concept::line
the type C must be convertible to the coordinate_type of L
the type C must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by set_source().

template<typename L , typename C >
void instigate::geometry::set_target_x ( L &  l,
const C &  x 
) [inline]

Set target x coordinate of line to given value.

Parameters:
l - a line
x - a new value for the x coordinate of l
Precondition:
the type L must be model of instigate::geometry::concept::line
the type C must be convertible to the coordinate_type of L
the type C must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename L , typename C >
void instigate::geometry::set_target_y ( L &  l,
const C &  y 
) [inline]

Set target y coordinate of line to given value.

Parameters:
l - a line
y - a new value for the y coordinate of l
Precondition:
the type L must be model of instigate::geometry::concept::line
the type C must be convertible to the coordinate_type of L
the type C must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename R , typename P >
void instigate::geometry::set_top ( R &  r,
const P &  x 
) [inline]

set top coordinate of the rectangle

Parameters:
r - a rectangle
x - a top coordinate of the rectangle
Precondition:
the type R must be model of instigate::geometry::concept::rectangle
the type P must be convertible to the coordinate_type of R
the type P must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

template<typename P , typename C >
void instigate::geometry::set_x ( P &  p,
const C &  c 
) [inline]

Set x coordinate of a point to given value.

Parameters:
p - a point
c - a new value for the x coordinate of p
Precondition:
the type P must be model of instigate::geometry::concept::point
the type C must be numeric type
the type C must be convertible to the coordinate_type of P
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by get_first_nearest_point(), get_second_nearest_point(), and instigate::geometry::concept::point::requirements< T >::require_set_x().

template<typename P , typename C >
void instigate::geometry::set_y ( P &  p,
const C &  c 
) [inline]

Set y coordinate of a point to given value.

Parameters:
p - a point
c - a new value for the y coordinate of p
Precondition:
the type P must be model of instigate::geometry::concept::point
the type C must be convertible to the coordinate_type of P
the type C must be numeric type
Complexity
O(1)

References CHECK, and CHECK_CONVERTIBILITY.

Referenced by get_first_nearest_point(), get_second_nearest_point(), and instigate::geometry::concept::point::requirements< T >::require_set_y().



© Instigate CJSC, Open Source