クラス rcsc::Polygon2D

2D polygon region class [詳細]

#include <polygon_2d.h>

すべてのメンバ一覧

Public メソッド

 Polygon2D ()
 create empty polygon
 Polygon2D (const std::vector< Vector2D > &v)
 create polygon with points
const Polygon2Dassign ()
 set polygon to empty polygon
const Polygon2Dassign (const std::vector< Vector2D > &v)
 set polygon with points
void addVertex (const Vector2D &p)
 append point to polygon
const std::vector< Vector2D > & vertex () const
 get list of point of this polygon
std::vector< Vector2D > & vertex ()
 get list of point of this polygon
bool contains (const Vector2D &p, bool allow_on_segment=true) const
 check point is in this polygon or not
Rect2D getBoundingBox () const
 get bounding box of this polygon
Vector2D xyCenter () const
 get centor of bounding box of this polygon
double dist (const Vector2D &p, bool check_as_plane=true) const
 get minimum distance between this polygon and point
double area () const
 get area of this polygon
double signedArea2 () const
 get area with sign
bool isCounterclockwise () const
 check vertexes of this polygon is placed counterclockwise ot not
bool isClockwise () const
 check vertexes of this polygon is placed clockwise ot not
Polygon2D getScissoredConnectedPolygon (const Rect2D &r) const
 get a polygon clipped by a rectangle


説明

2D polygon region class


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

rcsc::Polygon2D::Polygon2D ( const std::vector< Vector2D > &  v  ) 

create polygon with points

引数:
v array of points


関数

const Polygon2D & rcsc::Polygon2D::assign (  ) 

set polygon to empty polygon

戻り値:
const reference to itself

const Polygon2D & rcsc::Polygon2D::assign ( const std::vector< Vector2D > &  v  ) 

set polygon with points

引数:
v array of points
戻り値:
const reference to itself

void rcsc::Polygon2D::addVertex ( const Vector2D p  ) 

append point to polygon

引数:
p new point

const std::vector< Vector2D > & rcsc::Polygon2D::vertex (  )  const

get list of point of this polygon

戻り値:
const reference to point list

std::vector< Vector2D > & rcsc::Polygon2D::vertex (  ) 

get list of point of this polygon

戻り値:
reference to point list

bool rcsc::Polygon2D::contains ( const Vector2D p,
bool  allow_on_segment = true 
) const

check point is in this polygon or not

引数:
p point for checking
allow_on_segment when point is on outline, if this parameter is set to true, returns true
戻り値:
true if point is in this polygon

Rect2D rcsc::Polygon2D::getBoundingBox (  )  const

get bounding box of this polygon

戻り値:
bounding box of this polygon

Vector2D rcsc::Polygon2D::xyCenter (  )  const

get centor of bounding box of this polygon

戻り値:
centor of bounding box of this polygon

double rcsc::Polygon2D::dist ( const Vector2D p,
bool  check_as_plane = true 
) const

get minimum distance between this polygon and point

引数:
p point
check_as_plane if this parameter is set to true, handle this polygon as a plane polygon, otherwise handle this polygon as a polyline polygon. when point is inside of this polygon, distance between plane polygon and point is 0, distance between polyline polygon and point is minimum distance between each segments of this polygon.
戻り値:
minimum distance between this polygon and point

double rcsc::Polygon2D::area (  )  const

get area of this polygon

戻り値:
value of area with sign.

double rcsc::Polygon2D::signedArea2 (  )  const

get area with sign

戻り値:
value of area with sign. If vertexes are placed counterclockwise order, returns positive number. If vertexes are placed clockwise order, returns negative number. Otherwise, returns 0.

bool rcsc::Polygon2D::isCounterclockwise (  )  const

check vertexes of this polygon is placed counterclockwise ot not

戻り値:
true if counterclockwise

bool rcsc::Polygon2D::isClockwise (  )  const

check vertexes of this polygon is placed clockwise ot not

戻り値:
true if clockwise

Polygon2D rcsc::Polygon2D::getScissoredConnectedPolygon ( const Rect2D r  )  const

get a polygon clipped by a rectangle

引数:
r rectangle for clipping
戻り値:
a polygon. if polygon is separated by edges of rectangle, each separated polygon is connected to one polygon.


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