18 #include <boost/geometry.hpp>
19 #include <boost/geometry/geometries/point.hpp>
20 #include <boost/geometry/geometries/box.hpp>
34 template<
typename TObject,
typename TBoxGen,
typename TComparator>
38 typedef boost::geometry::model::point<double,3,boost::geometry::cs::cartesian>
Tboost_point;
39 typedef boost::geometry::model::box<Tboost_point>
Tboost_box;
46 return boost::geometry::equals<Tboost_box,Tboost_box>(v1.first, v2.first)&&(v1.second == v2.second);
50 boost::geometry::index::quadratic<16>,
51 boost::geometry::index::indexable<TBoxPointerPair>,
53 typedef typename Trtree::const_query_iterator
Trtreeit;
72 TObject* old =
find(
object);
77 TObject* copy =
new TObject(
object);
86 TObject*
find(
const TObject&
object)
89 for(
auto it =
data_.qbegin(boost::geometry::index::intersects(box));
93 if(
compare_(it->second,&
object))
return it->second;
102 return find(
object)!=0;
123 static const double guard = 1.0e99;
124 auto it =
data_.qbegin(boost::geometry::index::intersects(
138 static const double guard = 1.0e99;
139 auto it =
data_.qbegin(boost::geometry::index::disjoint(
152 std::vector<TObject*> removeset;
157 removeset.push_back(itp.current()->second);
159 for(
auto obj: removeset)
remove(obj);
Definition: localboxset.h:36
boost::geometry::model::point< double, 3, boost::geometry::cs::cartesian > Tboost_point
Definition: localboxset.h:38
boost::geometry::model::box< Tboost_point > Tboost_box
Definition: localboxset.h:39
Trtree data_
Definition: localboxset.h:62
itpair getObjectsInRegion(double x0, double y0, double x1, double y1)
Definition: localboxset.h:121
TBoxGen boxgen_
Definition: localboxset.h:63
void insert(const TObject &object)
Definition: localboxset.h:70
boost::geometry::index::rtree< TBoxPointerPair, boost::geometry::index::quadratic< 16 >, boost::geometry::index::indexable< TBoxPointerPair >, EqualFunctor > Trtree
Definition: localboxset.h:52
std::pair< Tboost_box, TObject * > TBoxPointerPair
Definition: localboxset.h:40
int size() const
Definition: localboxset.h:115
bool contains(const TObject &object)
Definition: localboxset.h:100
void refocus(double x0, double y0, double x1, double y1)
Definition: localboxset.h:150
itpair getObjectsOutsideRegion(double x0, double y0, double x1, double y1)
Definition: localboxset.h:136
Trtree::const_query_iterator Trtreeit
Definition: localboxset.h:53
TComparator compare_
Definition: localboxset.h:64
TObject * find(const TObject &object)
Definition: localboxset.h:86
void remove(TObject *object)
Definition: localboxset.h:107
x0
Definition: adore_set_goal.py:25
y0
Definition: adore_set_goal.py:26
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
Definition: areaofeffectconverter.h:20
Definition: localboxset.h:42
TComparator compare_
Definition: localboxset.h:43
bool operator()(TBoxPointerPair const &v1, TBoxPointerPair const &v2) const
Definition: localboxset.h:44
Definition: localboxset.h:55
Trtreeit second
Definition: localboxset.h:56
Trtreeit & end()
Definition: localboxset.h:59
Trtreeit first
Definition: localboxset.h:56
itpair(Trtreeit first, Trtreeit second)
Definition: localboxset.h:57
Trtreeit & current()
Definition: localboxset.h:58