Limbo 3.5.4
Loading...
Searching...
No Matches
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...
class  vector

Enumerations

enum  orientation_2d_enum { HORIZONTAL = 0 , VERTICAL = 1 }
enum  slicing_orientation_2d {
  HORIZONTAL_SLICING = 1 , VERTICAL_SLICING = 2 , HOR_VER_SLICING = 3 , HOR_VER_SA_SLICING = 4 ,
  HOR_VER_AR_SLICING = 5
}
enum  direction_2d { LEFT = 0 , BOTTOM = 1 , RIGHT = 2 , TOP = 3 }
enum  winding_direction { CLOCKWISE = 0 , COUNTERCLOCKWISE = 1 , UNKNOWN_WINDING = 2 }

Functions

std::string to_string (slicing_orientation_2d slicing_orient)
 convert enum type of slicing orientation to string
template<typename PointSet>
coordinate_traits< typenamepoint_traits< typenamecontainer_traits< PointSet >::value_type >::coordinate_type >::area_type area (PointSet const &vPoint)
 calculate signed area of a polygon, the result is positive if its winding is CLOCKWISE
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
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
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

Detailed Description

namespace for Limbo.Geometry

Enumeration Type Documentation

◆ direction_2d

enum limbo::geometry::direction_2d

Definition at line 72 of file Geometry.h.

◆ orientation_2d_enum

enum limbo::geometry::orientation_2d_enum

Definition at line 31 of file Geometry.h.

◆ slicing_orientation_2d

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.

◆ winding_direction

enum limbo::geometry::winding_direction

Definition at line 83 of file Geometry.h.

Function Documentation

◆ area()

template<typename PointSet>
coordinate_traits< typenamepoint_traits< typenamecontainer_traits< PointSet >::value_type >::coordinate_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 357 of file Geometry.h.

◆ polygon2rectangle()

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.

◆ polygon2RectangleBoost() [1/2]

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

◆ polygon2RectangleBoost() [2/2]

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

◆ to_string()

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.