Limbo
|
a class implement conversion from manhattan polygon to rectangle More...
#include <Polygon2Rectangle.h>
Classes | |
struct | is_equal_type |
is equal helper More... | |
Public Types | |
typedef RectSet | rectangle_set_type |
internal rectangle set type | |
typedef PointSet | point_set_type |
internal point set type | |
typedef container_traits < point_set_type >::value_type | point_type |
internal point type | |
typedef point_traits < point_type > ::coordinate_type | coordinate_type |
point set type for polygon | |
typedef container_traits < rectangle_set_type > ::value_type | rectangle_type |
internal rectangle type | |
typedef coordinate_traits < coordinate_type > ::coordinate_distance | coordinate_distance |
coordinate distance type | |
typedef coordinate_traits < coordinate_type > ::manhattan_area_type | manhattan_area_type |
manhattan area type | |
Public Member Functions | |
Polygon2Rectangle (rectangle_set_type &vRect, slicing_orientation_2d slicing_orient=HORIZONTAL_SLICING) | |
constructor More... | |
template<typename InputIterator > | |
Polygon2Rectangle (rectangle_set_type &vRect, InputIterator input_begin, InputIterator input_end, slicing_orientation_2d slicing_orient) | |
constructor More... | |
template<typename InputIterator > | |
void | initialize (InputIterator input_begin, InputIterator input_end) |
initialize polygon points More... | |
bool | operator() () |
top api for limbo::geometry::Polygon2Rectangle More... | |
rectangle_set_type const & | get_rectangles () const |
get rectangles More... | |
bool | read (string const &filename) |
read polygon from file try to be compatible to gnuplot format More... | |
void | print (string const &filename) const |
print polygon to file in gnuplot format More... | |
Protected Member Functions | |
coordinate_type | get (point_type const &p, orientation_2d o) const |
get coordinate from point More... | |
coordinate_type | get (rectangle_type const &r, direction_2d d) const |
get coordinate from rectangle More... | |
void | set (point_type &p, orientation_2d o, coordinate_type v) const |
set coordinate of point More... | |
void | set (rectangle_type &r, direction_2d d, coordinate_type v) const |
set coordinate of rectangle More... | |
void | initialize (slicing_orientation_2d slicing_orient) |
initialize with slicing orientation it must be called before initializing other data More... | |
bool | find_Pk_Pl_Pm (point_type &Pk, point_type &Pl, point_type &Pm, orientation_2d const &orient) |
find Pk, Pl, Pm, please refer to the paper for definition Given points, find Pk, Pl and Pm More... | |
void | F (point_type const &point, orientation_2d const &orient) |
F function in the original paper remove point if found, otherwise insert. More... | |
Protected Attributes | |
map< orientation_2d, point_set_type > | m_mPoint |
rectangle_set_type & | m_vRect |
save all rectangles from conversion | |
slicing_orientation_2d | m_slicing_orient |
slicing orient | |
a class implement conversion from manhattan polygon to rectangle
PointSet | is the container for internal storing vertices of polygon according to some experiments, vector is much faster than list, and set |
RectSet | is the container storing output rectangles |
Definition at line 90 of file Polygon2Rectangle.h.
|
inline |
constructor
if slicing_orient == HORIZONTAL_SLICING or slicing_orient == VERTICAL_SLICING, only 1 copy of points is stored if slicing_orient == HOR_VER_SLICING, 2 copies of points sorted by different orientation are stored btw, slicing orientation is perpendicular to its corresponding sorting orientation
vRect | reference to the container for output rectangles |
slicing_orient | indicates the orientation of slicing |
Definition at line 118 of file Polygon2Rectangle.h.
|
inline |
constructor
InputIterator | represents the iterator type of point set container for construction only |
vRect | reference to container for rectangles |
input_begin | begin iterator of points |
input_end | end iterator of points |
slicing_orient | slicing orientation |
Definition at line 134 of file Polygon2Rectangle.h.
|
inlineprotected |
F function in the original paper remove point if found, otherwise insert.
point | a point to insert or remove |
orient | orientation |
Definition at line 617 of file Polygon2Rectangle.h.
|
inlineprotected |
find Pk, Pl, Pm, please refer to the paper for definition Given points, find Pk, Pl and Pm
Pk | the leftmost of the lowest points |
Pl | the next leftmost of the lowest points |
Pm | 1) Xk <= Xm < Xl 2) Ym is lowest but Ym > Yk (Yk == Yl) |
orient | orientation |
Definition at line 576 of file Polygon2Rectangle.h.
|
inlineprotected |
get coordinate from point
p | point |
o | orientation |
Definition at line 489 of file Polygon2Rectangle.h.
|
inlineprotected |
get coordinate from rectangle
r | rectangle |
d | direction |
Definition at line 496 of file Polygon2Rectangle.h.
|
inline |
|
inline |
initialize polygon points
InputIterator | represents the iterator type of point set container for construction only |
input_begin | begin iterator of points |
input_end | end iterator of points |
Definition at line 149 of file Polygon2Rectangle.h.
|
inlineprotected |
initialize with slicing orientation it must be called before initializing other data
slicing_orient | slicing orientation |
Definition at line 534 of file Polygon2Rectangle.h.
|
inline |
top api for limbo::geometry::Polygon2Rectangle
Definition at line 256 of file Polygon2Rectangle.h.
|
inline |
print polygon to file in gnuplot format
filename | output file name |
Definition at line 441 of file Polygon2Rectangle.h.
|
inline |
read polygon from file try to be compatible to gnuplot format
Definition at line 380 of file Polygon2Rectangle.h.
|
inlineprotected |
set coordinate of point
p | point |
o | orientation |
v | coordinate value |
Definition at line 503 of file Polygon2Rectangle.h.
|
inlineprotected |
set coordinate of rectangle
r | rectangle |
d | direction |
v | coordinate value |
Definition at line 510 of file Polygon2Rectangle.h.
|
protected |
save all points of a polygon 1~2 copies, sort by left lower or by lower left for HORIZONTAL key, sort by left lower for VERTICAL key, sort by lower left
Definition at line 669 of file Polygon2Rectangle.h.