クラス rcsc::Rect2D

2D rectangle regin class. [詳細]

#include <rect_2d.h>

すべてのメンバ一覧

Public メソッド

 Rect2D ()
 default constructor creates a zero area rectanble at (0,0)
 Rect2D (const double &left_x, const double &top_y, const double &length, const double &width)
 constructor
 Rect2D (const Vector2D &top_left, const double &length, const double &width)
 constructor with variables
 Rect2D (const Vector2D &top_left, const Size2D &size)
 constructor with variables
 Rect2D (const Vector2D &top_left, const Vector2D &bottom_right)
 constructor with 2 points.
const Rect2Dassign (const double &left_x, const double &top_y, const double &length, const double &width)
 assign new values
const Rect2Dassign (const Vector2D &top_left, const double &length, const double &width)
 assign new values
const Rect2Dassign (const Vector2D &top_left, const Size2D &size)
 assign new values
const Rect2DsetTopLeft (const double &x, const double &y)
 set a new top left corner point
const Rect2DsetTopLeft (const Vector2D &point)
 set a new top left corner point
const Rect2DsetCenter (const Vector2D &point)
 set a new center point. only top left corner is moved. size is not changed.
const Rect2DsetLength (const double &length)
 set a new x-range
const Rect2DsetWidth (const double &width)
 set a new y-range
const Rect2DsetSize (const double &length, const double &width)
 set a new size
const Rect2DsetSize (const Size2D &size)
 set a new size
bool contains (const Vector2D &point) const
 check if point is within this region.
const double & left () const
 get the left x coordinate of this rectangle.
double right () const
 get the right x coordinate of this rectangle.
const double & top () const
 get the top y coordinate of this rectangle.
double bottom () const
 get the bottom y coordinate of this rectangle.
double minX () const
 get minimum value of x coordinate of this rectangle
double maxX () const
 get maximum value of x coordinate of this rectangle
double minY () const
 get minimum value of y coordinate of this rectangle
double maxY () const
 get maximum value of y coordinate of this rectangle
const Size2Dsize () const
 get the XY range of this rectangle
Vector2D center () const
 get center point
const Vector2DtopLeft () const
 get the top-left corner point
Vector2D topRight () const
 get the top-right corner point
Vector2D bottomLeft () const
 get the bottom-left corner point
Vector2D bottomRight () const
 get the bottom-right corner point
Line2D leftEdge () const
 get the left edge line
Line2D rightEdge () const
 get the right edge line
Line2D topEdge () const
 get the top edge line
Line2D bottomEdge () const
 get the bottom edge line
int intersection (const Line2D &line, Vector2D *sol1, Vector2D *sol2) const
 calculate intersection point with line.
int intersection (const Ray2D &ray, Vector2D *sol1, Vector2D *sol2) const
 calculate intersection point with ray.
int intersection (const Segment2D &segment, Vector2D *sol1, Vector2D *sol2) const
 calculate intersection point with line segment.

Static Public メソッド

static Rect2D from_center (const Vector2D &center, const double &length, const double &width)
 create rectangle with center point and size.
static Rect2D from_center (const double &center_x, const double &center_y, const double &length, const double &width)
 create rectangle with center point and size.
static Rect2D from_corners (const Vector2D &top_left, const Vector2D &bottom_right)
 create rectangle with 2 corner points. just call one of constructor.


説明

2D rectangle regin class.

The model and naming rules are depend on soccer simulator environment -34.0 | | -52.5 ------+------- 52.5 | | 34.0


コンストラクタとデストラクタ

rcsc::Rect2D::Rect2D ( const double &  left_x,
const double &  top_y,
const double &  length,
const double &  width 
) [inline]

constructor

引数:
left_x left x
top_y top y
length length (x-range)
width width (y-range)

rcsc::Rect2D::Rect2D ( const Vector2D top_left,
const double &  length,
const double &  width 
) [inline]

constructor with variables

引数:
top_left top left point
length X range
width Y range

rcsc::Rect2D::Rect2D ( const Vector2D top_left,
const Size2D size 
) [inline]

constructor with variables

引数:
top_left top left point
size XY range

rcsc::Rect2D::Rect2D ( const Vector2D top_left,
const Vector2D bottom_right 
) [inline]

constructor with 2 points.

引数:
top_left top left vertex
bottom_right bottom right vertex
Even if argument point has incorrect values, the assigned values are normalized automatically.


関数

static Rect2D rcsc::Rect2D::from_center ( const Vector2D center,
const double &  length,
const double &  width 
) [inline, static]

create rectangle with center point and size.

引数:
center center point of new rectangle.
length length(x-range) of new rectangle.
width width(y-range) of new rectangle.

static Rect2D rcsc::Rect2D::from_center ( const double &  center_x,
const double &  center_y,
const double &  length,
const double &  width 
) [inline, static]

create rectangle with center point and size.

引数:
center_x x value of center point of new rectangle.
center_y y value of center point of new rectangle.
length length(x-range) of new rectangle.
width width(y-range) of new rectangle.

static Rect2D rcsc::Rect2D::from_corners ( const Vector2D top_left,
const Vector2D bottom_right 
) [inline, static]

create rectangle with 2 corner points. just call one of constructor.

引数:
top_left top left vertex
bottom_right bottom right vertex

const Rect2D& rcsc::Rect2D::assign ( const double &  left_x,
const double &  top_y,
const double &  length,
const double &  width 
) [inline]

assign new values

引数:
left_x left x
top_y top y
length X range
width Y range

const Rect2D& rcsc::Rect2D::assign ( const Vector2D top_left,
const double &  length,
const double &  width 
) [inline]

assign new values

引数:
top_left top left point
length X range
width Y range
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::assign ( const Vector2D top_left,
const Size2D size 
) [inline]

assign new values

引数:
top_left top left
size XY range
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setTopLeft ( const double &  x,
const double &  y 
) [inline]

set a new top left corner point

引数:
x new x coordinate
y new y coordinate
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setTopLeft ( const Vector2D point  )  [inline]

set a new top left corner point

引数:
point new coordinate
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setCenter ( const Vector2D point  )  [inline]

set a new center point. only top left corner is moved. size is not changed.

引数:
point new center coordinate
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setLength ( const double &  length  )  [inline]

set a new x-range

引数:
length new range
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setWidth ( const double &  width  )  [inline]

set a new y-range

引数:
width new range
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setSize ( const double &  length,
const double &  width 
) [inline]

set a new size

引数:
length new range
width new range
戻り値:
const referenct to itself

const Rect2D& rcsc::Rect2D::setSize ( const Size2D size  )  [inline]

set a new size

引数:
size new range
戻り値:
const referenct to itself

bool rcsc::Rect2D::contains ( const Vector2D point  )  const [inline]

check if point is within this region.

引数:
point considered point
戻り値:
true or false

const double& rcsc::Rect2D::left (  )  const [inline]

get the left x coordinate of this rectangle.

戻り値:
x coordinate value

double rcsc::Rect2D::right (  )  const [inline]

get the right x coordinate of this rectangle.

戻り値:
x coordinate value

const double& rcsc::Rect2D::top (  )  const [inline]

get the top y coordinate of this rectangle.

戻り値:
y coordinate value

double rcsc::Rect2D::bottom (  )  const [inline]

get the bottom y coordinate of this rectangle.

戻り値:
y coordinate value

double rcsc::Rect2D::minX (  )  const [inline]

get minimum value of x coordinate of this rectangle

戻り値:
x coordinate value (equivalent to left())

double rcsc::Rect2D::maxX (  )  const [inline]

get maximum value of x coordinate of this rectangle

戻り値:
x coordinate value (equivalent to right())

double rcsc::Rect2D::minY (  )  const [inline]

get minimum value of y coordinate of this rectangle

戻り値:
y coordinate value (equivalent to top())

double rcsc::Rect2D::maxY (  )  const [inline]

get maximum value of y coordinate of this rectangle

戻り値:
y coordinate value (equivalent to bottom())

const Size2D& rcsc::Rect2D::size (  )  const [inline]

get the XY range of this rectangle

戻り値:
size object

Vector2D rcsc::Rect2D::center (  )  const [inline]

get center point

戻り値:
coordinate value by vector object

const Vector2D& rcsc::Rect2D::topLeft (  )  const [inline]

get the top-left corner point

戻り値:
coordiante value by vector object

Vector2D rcsc::Rect2D::topRight (  )  const [inline]

get the top-right corner point

戻り値:
coordiante value by vector object

Vector2D rcsc::Rect2D::bottomLeft (  )  const [inline]

get the bottom-left corner point

戻り値:
coordiante value by vector object

Vector2D rcsc::Rect2D::bottomRight (  )  const [inline]

get the bottom-right corner point

戻り値:
coordiante value by vector object

Line2D rcsc::Rect2D::leftEdge (  )  const [inline]

get the left edge line

戻り値:
line object

Line2D rcsc::Rect2D::rightEdge (  )  const [inline]

get the right edge line

戻り値:
line object

Line2D rcsc::Rect2D::topEdge (  )  const [inline]

get the top edge line

戻り値:
line object

Line2D rcsc::Rect2D::bottomEdge (  )  const [inline]

get the bottom edge line

戻り値:
line object

int rcsc::Rect2D::intersection ( const Line2D line,
Vector2D sol1,
Vector2D sol2 
) const

calculate intersection point with line.

引数:
line considerd line.
sol1 pointer to the 1st solution variable
sol2 pointer to the 2nd solution variable
戻り値:
number of intersection

int rcsc::Rect2D::intersection ( const Ray2D ray,
Vector2D sol1,
Vector2D sol2 
) const

calculate intersection point with ray.

引数:
ray considerd ray line.
sol1 pointer to the 1st solution variable
sol2 pointer to the 2nd solution variable
戻り値:
number of intersection

int rcsc::Rect2D::intersection ( const Segment2D segment,
Vector2D sol1,
Vector2D sol2 
) const

calculate intersection point with line segment.

引数:
segment considerd line segment.
sol1 pointer to the 1st solution variable
sol2 pointer to the 2nd solution variable
戻り値:
number of intersection


このクラスの説明は次のファイルから生成されました:
librcscに対してThu May 1 15:41:26 2008に生成されました。  doxygen 1.5.0