コード例 #1
0
    ElementPtr Node::getLastSiblingElement() const
    {
      NodePtr found = getParent();
      if (found)
        return found->getLastChildElement();

      return ElementPtr();
    }
コード例 #2
0
    //-------------------------------------------------------------------------
    ElementPtr MediaDevices::singletonToDebug()
    {

      MediaDevicesPtr pThis(MediaDevices::singleton());
      if (!pThis) return ElementPtr();

      AutoRecursiveLock lock(*pThis);
      return pThis->toDebug();
    }
コード例 #3
0
ファイル: GrmlRenderer.cpp プロジェクト: rogerclark/grumble
	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();
	}
コード例 #4
0
    ElementPtr Node::getNextSiblingElement() const
    {
      NodePtr found = getNextSibling();
      while (found)
      {
        if (found->isElement())
          return found->toElement();

        found = found->getNextSibling();
      }
      return ElementPtr();
    }
コード例 #5
0
    ElementPtr Node::getLastChildElement() const
    {
      NodePtr found = getLastChild();
      while (found)
      {
        if (found->isElement())
          return found->toElement();

        found = found->getPreviousSibling();
      }
      return ElementPtr();
    }
コード例 #6
0
    ElementPtr Node::getParentElement() const
    {
      NodePtr found = getParent();
      while (found)
      {
        if (found->isElement())
          return found->toElement();

        found = found->getParent();
      }
      return ElementPtr();
    }
コード例 #7
0
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;
}
コード例 #8
0
    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;
    }
コード例 #9
0
 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();
 }
コード例 #10
0
ファイル: Gui.cpp プロジェクト: mdecicco/SandboxSimulator2014
 void GUIManager::AddElement(GuiElement* Ele)
 {
     m_Elements.push_back(std::move(ElementPtr(Ele)));
 }
コード例 #11
0
ファイル: Gui.cpp プロジェクト: mdecicco/SandboxSimulator2014
 GuiElement* GUIManager::MakeElement(RenderComponent* r)
 {
     GuiElement* Ele = new GuiElement(r);
     m_Elements.push_back(std::move(ElementPtr(Ele)));
     return Ele;
 }