21 #ifndef OPHIDIAN_SUBROWS_H
22 #define OPHIDIAN_SUBROWS_H
24 #include <boost/geometry/index/rtree.hpp>
25 #include "floorplan.h"
26 #include <placement.h>
27 #include <entity_system.h>
31 namespace legalization {
32 using point = geometry::point<double>;
33 using box = geometry::box<point>;
34 using rtree_node = std::pair<box, entity_system::entity>;
35 using rtree = boost::geometry::index::rtree<rtree_node, boost::geometry::index::rstar<16>>;
55 return m_system.
size();
60 double begin(entity_system::entity subrow) {
61 return m_begin[m_system.
lookup(subrow)];
63 void begin(entity_system::entity subrow,
double begin);
65 double end(entity_system::entity subrow) {
66 return m_end[m_system.
lookup(subrow)];
68 void end(entity_system::entity subrow,
double end);
70 entity_system::entity row(entity_system::entity subrow) {
71 return m_row[m_system.
lookup(subrow)];
73 void row(entity_system::entity subrow, entity_system::entity row);
75 entity_system::entity find_subrow(point coordinate);
77 std::vector<entity_system::entity> find_closest_subrows(point coordinate,
unsigned number_of_rows);
83 const char * what()
const throw() {
84 return "No subrow found in the given coordinate";
92 #endif //OPHIDIAN_SUBROWS_H
Placement class.
Definition: placement.h:35
entity_system class.
Definition: entity_system.h:40
std::size_t size() const
Returns the size of the system.
Definition: entity_system.h:82
Floorplan class.
Definition: floorplan.h:37
entity_index lookup(entity e) const
Gets the index of an entity.
Definition: entity_system.h:149
void register_property(property *property)
Registers property.
Definition: entity_system.cpp:61