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


C++ QCPGraph::setScatterSize方法代码示例

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


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

示例1: onPacketParsed

void MainWindow::onPacketParsed(Packet packet)
{
    _packetsReceivedCount++;

    if(!packet.isCrcValid())
    {
        _crcErrorCount++;
    }

    QString sourceId = ByteArrayUtils::toString(packet.sourceId()).replace(" 0x", "").replace("0x", "");
    if(!_rssValues.contains(sourceId))
    {
        _rssValues.insert(sourceId, QVector<double>());
        _timestampValues.insert(sourceId, QVector<double>());

        QCPGraph* deviceGraph = ui->plotWidget->addGraph();
        deviceGraph->setScatterStyle(QCP::ssDisc);
        deviceGraph->setScatterSize(5);
        deviceGraph->setName(sourceId);
        ensureDistinctColors();
    }

    _rssValues[sourceId].append(packet.rss());
    _timestampValues[sourceId].append(packet.timestamp().toTime_t());
    updatePlot();

    updateStatus();
}
开发者ID:GlennVDLocht,项目名称:dash7-ap-open-source-stack,代码行数:28,代码来源:mainwindow.cpp

示例2: updatePlot


//.........这里部分代码省略.........
    case(FIELD4):
        field = Global::getInstance()->getExtraField(3);
        ui->customPlot->yAxis->setLabel(field.axisLabel);
        break;
    default:
        assert(false);
        break;
    }

    //
    bool buildGlobalPlot = (selectionGraph->isEmpty());

    set<Group> groups;
    map<Group,vector<SelectionGraphNode*> > mapGroupToNodes;
    map<Group,vector<SelectionGraphEdge*> > mapGroupToEdges;
    set<Group>::iterator groupIterator;
    selectionGraph->groupNodesAndEdgeByColor(groups,mapGroupToNodes,mapGroupToEdges);
    map<Group,QCPGraph*> mapGroupGraph;

    //
    set<Group> notEmptyGroups;
    map<Group,vector<SelectionGraphNode*> > tempMapGroupToNodes;

    if(buildGlobalPlot){
        QPen pen;
        QCPGraph* graph = ui->customPlot->addGraph();
        QColor color(0,0,0);
        mapGroupGraph[Group(color)] = graph;
        color.setAlphaF(0.05);
        pen.setColor(color);
        graph->setPen(pen);
        graph->setLineStyle(QCPGraph::lsNone);
        graph->setScatterStyle(QCP::ssDisc);
        graph->setScatterSize(10);
    }
    else{
        //
        for(groupIterator = groups.begin() ; groupIterator != groups.end() ; ++groupIterator){
            vector<SelectionGraphNode*> &groupNodes = mapGroupToNodes[*groupIterator];
            vector<SelectionGraphNode*> validGroupNodes;
            int numGroupNodes = groupNodes.size();

            for(int i = 0 ; i < numGroupNodes ; ++i){
                SelectionGraphNode* node = groupNodes.at(i);
                if(node->inDegree() + node->outDegree() == 0)
                    validGroupNodes.push_back(node);
            }

            vector<SelectionGraphEdge*> &groupEdges = mapGroupToEdges[*groupIterator];
            if(groupEdges.size() + validGroupNodes.size() > 0){
                notEmptyGroups.insert(*groupIterator);
                tempMapGroupToNodes[*groupIterator] = validGroupNodes;
            }
        }

        groups.clear();
        groups = notEmptyGroups;
        mapGroupToNodes.clear();
        mapGroupToNodes = tempMapGroupToNodes;

        //
        for(groupIterator = groups.begin() ; groupIterator != groups.end() ; ++groupIterator){
            QPen pen;
            QCPGraph* graph = ui->customPlot->addGraph();
            graph->setLineStyle(QCPGraph::lsNone);
            graph->setScatterStyle(QCP::ssDisc);
开发者ID:Rambo2015,项目名称:TaxiVis,代码行数:67,代码来源:scatterplotwidget.cpp


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