本文整理汇总了C++中Tags::addTags方法的典型用法代码示例。如果您正苦于以下问题:C++ Tags::addTags方法的具体用法?C++ Tags::addTags怎么用?C++ Tags::addTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tags
的用法示例。
在下文中一共展示了Tags::addTags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void KeepTagsVisitor::visit(const shared_ptr<Element>& e)
{
//get a copy of the tags for modifying
Tags tags;
tags.addTags(e->getTags());
for (Tags::const_iterator it = e->getTags().begin(); it != e->getTags().end(); ++it)
{
if (!_keys.contains(it.key()))
{
tags.remove(it.key());
}
}
e->setTags(tags);
}
示例2: _decomposeBuilding
void DecomposeBuildingRelationsVisitor::_decomposeBuilding(const shared_ptr<Relation>& r)
{
Tags baseTags = r->getTags();
const vector<RelationData::Entry> members = r->getMembers();
for (size_t i = 0; i < members.size(); ++i)
{
ElementId eid = members[i].getElementId();
r->removeElement(eid);
if (eid.getType() == ElementType::Node)
{
LOG_WARN("Unexpected node encountered in building relation. " << r->getElementId());
continue;
}
// we're dropping the outline. We only care about the parts.
else if (members[i].getRole() == "outline")
{
continue;
}
else if (members[i].getRole() != "part")
{
LOG_WARN("Encountered an unexpected role in a building relation. " << r->getElementId());
}
// ok, we've got a building part. Recompose it as a building.
shared_ptr<Element> e = _map->getElement(members[i].getElementId());
Tags t = baseTags;
t.addTags(e->getTags());
// don't need the building:part tag anymore.
t.remove("building:part");
if (!t.contains("building"))
{
t["building"] = "yes";
}
e->setTags(t);
}
// remove the building relation
RecursiveElementRemover(r->getElementId()).apply(_map->shared_from_this());
}