示例#1
0
LODNode DataSourcePlugin::getNode(const NodeId& nodeId) const
{
    IdLODNodeMap::iterator it;
    {
        ReadLock lock(_mutex);
        it = _lodNodeMap.find(nodeId.getId());
        if (it != _lodNodeMap.end())
            return it->second;
    }

    WriteLock writeLock(_mutex);
    it = _lodNodeMap.find(nodeId.getId());
    if (it == _lodNodeMap.end())
    {
        const LODNode& node = internalNodeToLODNode(nodeId);
        _lodNodeMap[nodeId.getId()] = node;
    }

    return _lodNodeMap[nodeId.getId()];
}
示例#2
0
void TreeView::selectItem(NodeId id)
{
	QModelIndex index = model->findByNodeId(id.getId());
	if (index.isValid())
		selectItem(index);
}