Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Enumerations | Functions
limbo::geometry Namespace Reference

namespace for Limbo.Geometry More...

Classes

class  container_traits
 type traits for containers such as vector, list, multiset More...
 
struct  container_traits< std::list< T > >
 partial specialization of limbo::geometry::container_traits for commonly used data structures like std::list More...
 
struct  container_traits< std::vector< T > >
 partial specialization of limbo::geometry::container_traits for commonly used data structures like std::vector More...
 
struct  coordinate_traits
 type traits for coordinates More...
 
struct  coordinate_traits< int >
 specialization for default integer type More...
 
class  orientation_2d
 a class denoting orientation of lines More...
 
class  point_compare_type
 sort helper if orient == HORIZONTAL, sort by left lower if orient == VERTICAL, sort by lower left More...
 
class  point_traits
 type traits for point More...
 
struct  point_traits< bLib::bPoint >
 specialization of limbo::geometry::point_traits for bLib::bPoint More...
 
struct  point_traits< boost::polygon::point_data< T > >
 specialization of limbo::geometry::point_traits for boost::polygon::point_data More...
 
struct  point_traits< Point >
 if your point class setting is different from that in the default point_traits, please create a specialization More...
 
class  Polygon2Rectangle
 a class implement conversion from manhattan polygon to rectangle More...
 
class  Polygon2Rectangle< std::vector< PointType >, std::vector< RectangleType > >
 a class implement conversion from manhattan polygon to rectangle More...
 
class  rectangle_traits
 type traits for rectangle More...
 
struct  rectangle_traits< bLib::bBox >
 specialization of limbo::geometry::rectangle_traits for bLib::bBox More...
 
struct  rectangle_traits< boost::polygon::rectangle_data< T > >
 specialization of limbo::geometry::rectangle_traits for boost::polygon::rectangle_data More...
 
struct  rectangle_traits< Rectangle >
 if your rectangle class setting is different from that in the default point_traits, please create a specialization More...
 

Enumerations

enum  orientation_2d_enum { HORIZONTAL = 0, VERTICAL = 1 }
 orientation type for lines
 
enum  slicing_orientation_2d {
  HORIZONTAL_SLICING = 1, VERTICAL_SLICING = 2, HOR_VER_SLICING = 3, HOR_VER_SA_SLICING = 4,
  HOR_VER_AR_SLICING = 5
}
 orientation type for slicing More...
 
enum  direction_2d { LEFT = 0, BOTTOM = 1, RIGHT = 2, TOP = 3 }
 direction type for rectangles
 
enum  winding_direction { CLOCKWISE = 0, COUNTERCLOCKWISE = 1, UNKNOWN_WINDING = 2 }
 winding direction type CLOCKWISE and COUNTERCLOCKWISE refers to winding direction of a polygon
 

Functions

std::string to_string (slicing_orientation_2d slicing_orient)
 convert enum type of slicing orientation to string More...
 
template<typename PointSet >
coordinate_traits< typename
point_traits< typename
container_traits< PointSet >
::value_type >::area_type > 
area (PointSet const &vPoint)
 calculate signed area of a polygon, the result is positive if its winding is CLOCKWISE More...
 
template<typename InputIterator , typename PointSet , typename RectSet >
bool polygon2rectangle (InputIterator input_begin, InputIterator input_end, PointSet const &, RectSet &r, slicing_orientation_2d slicing_orient=HORIZONTAL_SLICING)
 standby function for polygon-to-rectangle conversion More...
 
bool polygon2RectangleBoost (std::vector< gtl::point_data< int > > const &vPoint, std::vector< gtl::rectangle_data< int > > &vRectangle)
 this function takes a set of points describing a rectilinear polygon and decomposes it into rectangles More...
 
bool polygon2RectangleBoost (gtl::polygon_90_data< int > const &polygon, std::vector< gtl::rectangle_data< int > > &vRectangle)
 this function takes a rectilinear polygon and decomposes it into rectangles More...
 

Detailed Description

namespace for Limbo.Geometry

Enumeration Type Documentation

orientation type for slicing

Enumerator
HOR_VER_SLICING 

horizontal/vertical slicing and choose rectangle with larger area every time

HOR_VER_SA_SLICING 

horizontal/vertical slicing and choose rectangle with smaller area every time

HOR_VER_AR_SLICING 

horizontal/vertical slicing and choose rectangle with better aspect ratio every time

Definition at line 39 of file Geometry.h.

Function Documentation

template<typename PointSet >
coordinate_traits<typename point_traits<typename container_traits<PointSet>::value_type>::area_type> limbo::geometry::area ( PointSet const &  vPoint)
inline

calculate signed area of a polygon, the result is positive if its winding is CLOCKWISE

Template Parameters
PointSetpoint set type

Definition at line 330 of file Geometry.h.

template<typename InputIterator , typename PointSet , typename RectSet >
bool limbo::geometry::polygon2rectangle ( InputIterator  input_begin,
InputIterator  input_end,
PointSet const &  ,
RectSet &  r,
slicing_orientation_2d  slicing_orient = HORIZONTAL_SLICING 
)
inline

standby function for polygon-to-rectangle conversion

Template Parameters
InputIteratorrepresents the input iterators for points of polygon
PointSetrepresents the internal container for points of polygon, user needs to pass a hint for type deduction
RectSetrepresents the container for rectangles
Parameters
input_beginbegin iterator of input
input_endend iterator of input
rreference to container for rectangles
slicing_orientslicing orientations
Returns
true if succeed

Definition at line 698 of file Polygon2Rectangle.h.

bool limbo::geometry::polygon2RectangleBoost ( std::vector< gtl::point_data< int > > const &  vPoint,
std::vector< gtl::rectangle_data< int > > &  vRectangle 
)

this function takes a set of points describing a rectilinear polygon and decomposes it into rectangles

Parameters
vPointa set of points as input
vRectanglea set of rectangles as output
Returns
true if succeeded
bool limbo::geometry::polygon2RectangleBoost ( gtl::polygon_90_data< int > const &  polygon,
std::vector< gtl::rectangle_data< int > > &  vRectangle 
)

this function takes a rectilinear polygon and decomposes it into rectangles

Parameters
polygonrectilinear polygon as input
vRectanglea set of rectangles as output
Returns
true if succeeded
std::string limbo::geometry::to_string ( slicing_orientation_2d  slicing_orient)
inline

convert enum type of slicing orientation to string

Parameters
slicing_orientslicing orientation
Returns
string denoting slicing orientation

Definition at line 51 of file Geometry.h.