ObjMapObject ObjectLayer::find_object(const CL_Pointf& click_pos) { for(Objects::reverse_iterator i = impl->objects.rbegin(); i != impl->objects.rend(); ++i) { CL_Rectf rect = (*i).get_bound_rect(); if (rect.is_inside(CL_Point(click_pos))) return *i; } return ObjMapObject(); }
ObjectLayer::Objects ObjectLayer::get_selection(const CL_Rectf& rect) { Objects selection; for(Objects::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i) { // FIXME: if (rect.is_inside((*i).get_pos())) { selection.push_back(*i); } } return selection; }