ElementPtr Node::getLastSiblingElement() const { NodePtr found = getParent(); if (found) return found->getLastChildElement(); return ElementPtr(); }
//------------------------------------------------------------------------- ElementPtr MediaDevices::singletonToDebug() { MediaDevicesPtr pThis(MediaDevices::singleton()); if (!pThis) return ElementPtr(); AutoRecursiveLock lock(*pThis); return pThis->toDebug(); }
ElementPtr Renderer::ElementFromPoint(int x, int y) { for (std::list<ElementPtr>::iterator i = m_zOrder.begin(); i != m_zOrder.end(); ++i) { Gdiplus::Rect r = (*i)->GetBoundingRect(); if (r.Contains(x, y)) return (*i); } return ElementPtr(); }
ElementPtr Node::getNextSiblingElement() const { NodePtr found = getNextSibling(); while (found) { if (found->isElement()) return found->toElement(); found = found->getNextSibling(); } return ElementPtr(); }
ElementPtr Node::getLastChildElement() const { NodePtr found = getLastChild(); while (found) { if (found->isElement()) return found->toElement(); found = found->getPreviousSibling(); } return ElementPtr(); }
ElementPtr Node::getParentElement() const { NodePtr found = getParent(); while (found) { if (found->isElement()) return found->toElement(); found = found->getParent(); } return ElementPtr(); }
MatchClassification MultiaryScoreCache::getScore(ConstElementPtr e1, ConstElementPtr e2) { _lastExplainText.clear(); OsmMapPtr tmp(new OsmMap(_map->getProjection())); tmp->addElement(ElementPtr(e1->clone())); tmp->addElement(ElementPtr(e2->clone())); boost::scoped_ptr<Match> m( _matchCreator->createMatch(tmp, e1->getElementId(), e2->getElementId())); // default to a hard miss. MatchClassification result(0, 1, 0); // if the MatchCreator returns a valid match class, use that as the score. if (m) { result = m->getClassification(); _lastExplainText = m->explain(); } return result; }
ElementPtr Node::getRootElement() const { ElementPtr found; if (isElement()) { found = toElement(); } else { found = getParentElement(); } if (!found) return ElementPtr(); ElementPtr parent = found->getParentElement(); while (parent) { found = parent; parent = parent->getParentElement(); } return found; }
ElementPtr Node::findLastChildElement(String elementName) const { bool caseSensative = true; DocumentPtr document = getDocument(); if (document) caseSensative = document->isElementNameIsCaseSensative(); ElementPtr element = getLastChildElement(); while (element) { if (caseSensative) { if (elementName == element->getValue()) return element; } else { if (0 == elementName.compareNoCase(element->getValue())) return element; } element = element->getPreviousSiblingElement(); } return ElementPtr(); }
void GUIManager::AddElement(GuiElement* Ele) { m_Elements.push_back(std::move(ElementPtr(Ele))); }
GuiElement* GUIManager::MakeElement(RenderComponent* r) { GuiElement* Ele = new GuiElement(r); m_Elements.push_back(std::move(ElementPtr(Ele))); return Ele; }