30#ifndef RCSC_GEOM_POLYGON2D_H
31#define RCSC_GEOM_POLYGON2D_H
49 std::vector< Vector2D > M_vertices;
61 Polygon2D(
const std::vector< Vector2D > & v );
81 M_vertices.push_back( p );
88 const std::vector< Vector2D > &
vertices()
const
112 const bool allow_on_segment )
const;
139 const bool check_as_plane =
true )
const;
2D polygon region class
Definition polygon_2d.h:47
virtual double area() const
get area of this polygon
Definition polygon_2d.cpp:319
double dist(const Vector2D &p, const bool check_as_plane=true) const
get minimum distance between this polygon and point
Definition polygon_2d.cpp:267
const std::vector< Vector2D > & vertices() const
get list of point of this polygon
Definition polygon_2d.h:88
bool isClockwise() const
check vertexes of this polygon is placed clockwise ot not
Definition polygon_2d.cpp:367
Vector2D xyCenter() const
get centor of bounding box of this polygon
Definition polygon_2d.cpp:141
virtual bool contains(const Vector2D &p) const
check point is in this polygon or not. the point on segment lines is allowed.
Definition polygon_2d.h:99
Polygon2D getScissoredConnectedPolygon(const Rect2D &r) const
get a polygon clipped by a rectangle
Definition polygon_2d.cpp:528
void clear()
clear all data.
Definition polygon_2d.cpp:73
double doubleSignedArea() const
calculate doubled signed area value
Definition polygon_2d.cpp:329
Polygon2D()
create empty polygon
Definition polygon_2d.cpp:52
void addVertex(const Vector2D &p)
append point to polygon
Definition polygon_2d.h:79
const Polygon2D & assign(const std::vector< Vector2D > &v)
set polygon with points
Definition polygon_2d.cpp:83
bool isCounterclockwise() const
check vertexes of this polygon is placed counterclockwise ot not
Definition polygon_2d.cpp:357
Rect2D getBoundingBox() const
get bounding box of this polygon
Definition polygon_2d.cpp:94
2D rectangle regin class.
Definition rect_2d.h:59
Region2D()
accessible only from derived classes
Definition region_2d.h:49
2D point vector class
Definition vector_2d.h:47
abstract 2D region class Header File.