本文整理汇总了C++中PlotCurve::sectorOn方法的典型用法代码示例。如果您正苦于以下问题:C++ PlotCurve::sectorOn方法的具体用法?C++ PlotCurve::sectorOn怎么用?C++ PlotCurve::sectorOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlotCurve
的用法示例。
在下文中一共展示了PlotCurve::sectorOn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: highlightSector
void PlotScene::highlightSector(float t1, float t2, const QVariant& trackId)
{
qDebug() << "sector délimité sur mapping. Bornes : " << t1 << t2;
PlotCurve* targetPlotCurve = NULL;
// Find the curve associate to trackId of the point selected on the mapping
for(int i(0); targetPlotCurve == NULL && i < this->curves.count(); i++)
if (this->curves.at(i)->id() == trackId)
targetPlotCurve = this->curves[i];
if (targetPlotCurve == NULL)
{
qDebug() << "No PlotCurve associate to the trackId found";
return;
}
/* Get the sector that contains all the points
* corresponding to the time interval t1 to t2 */
AnimateSectorItem* sect = targetPlotCurve->sectorOn(t1, t2);
if (sect == NULL)
{
qDebug() << "impossible de déterminer le secteur correspondant "
<< "à la sélection de la vue mapping";
return;
}
// The sector will have the same color that the curve
sect->setBrush(targetPlotCurve->getPen().brush());
/* Create the group that will contain all the GraphicsItem corresponding
* to the selected zone or point */
if (this->selectedGroup == NULL)
{
this->selectedGroup = new QGraphicsItemGroup;
this->addItem(this->selectedGroup);
}
this->selectedGroup->addToGroup(sect);
sect->launchAnimation();
}