当前位置: 首页>>代码示例>>C++>>正文


C++ Attributes::getXsValue方法代码示例

本文整理汇总了C++中Attributes::getXsValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Attributes::getXsValue方法的具体用法?C++ Attributes::getXsValue怎么用?C++ Attributes::getXsValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attributes的用法示例。


在下文中一共展示了Attributes::getXsValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: decode

bool AgentObserverMap::decode(QDataStream &in, TypesOfSubjects subject)
{
    bool ret = false;
    QString msg;
    in >> msg;

    // qDebug() << msg.split(PROTOCOL_SEPARATOR, QString::SkipEmptyParts);

    Attributes * attrib = 0;
    
    if (subject == TObsTrajectory)
    {
        attrib = getMapAttributes()->value("trajectory");
    }
    else
    {
		//@RAIAN: Neighborhood
		if(subject == TObsCell)
		{
			attrib = getMapAttributes()->value(className);
		}
		//@RAIAN: FIM
		else
		{
            // // ((subjectType == TObsAgent) || (subjectType == TObsAutomaton))
            // attrib = getMapAttributes()->value("currentState" + className);

            foreach (Attributes *attr, getMapAttributes()->values())
            {
                if (attr->getClassName() == className)
                {
                    attrib = attr;
                    break;
                }
            }
        }
    }
    if (attrib)
    {
        if (cleanImage)
            attrib->clear();

        ret = getProtocolDecoder().decode(msg, *attrib->getXsValue(), *attrib->getYsValue());
        // getPainterWidget()->plotMap(attrib);
    }
    qApp->processEvents();
    return ret;
}
开发者ID:saraiva3,项目名称:terrame,代码行数:48,代码来源:agentObserverMap.cpp

示例2: draw

bool ObserverMap::draw(QDataStream &state)
{
    bool decoded = false;
    QString msg;
    state >> msg;

    QList<Attributes *> listAttribs = mapAttributes->values();
    Attributes * attrib = 0;

    connectTreeLayerSlot(false);
    for (int i = 0; i < listAttribs.size(); i++)
    {
        attrib = listAttribs.at(i);
        if (attrib->getType() == TObsCell)
        {
            attrib->clear();

            decoded = protocolDecoder->decode(msg, *attrib->getXsValue(), *attrib->getYsValue());
            if (decoded)
                painterWidget->plotMap(attrib);
        }
        qApp->processEvents();
    }

    connectTreeLayerSlot(true);

    // cria a legenda e exibe na tela
	//@RAIAN: Troquei esta comparacao porque nao estava criando a legenda da segunda camada (No meu caso, a vizinhanca)
    //if (/*decoded &&*/ legendWindow && (builtLegend < 1))
	if ((legendWindow) && (builtLegend < mapAttributes->size()))
    {
	//@RAIAN: FIM
        connectTreeLayerSlot(false);
        legendWindow->makeLegend();
        showLayerLegend();

        painterWidget->replotMap();
        connectTreeLayerSlot(true);

        // exibe o zoom de janela
        zoomWindow();
        builtLegend++;
    }

    return decoded;
}
开发者ID:,项目名称:,代码行数:46,代码来源:


注:本文中的Attributes::getXsValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。