本文整理汇总了C++中QwtPlotMarker::lineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::lineStyle方法的具体用法?C++ QwtPlotMarker::lineStyle怎么用?C++ QwtPlotMarker::lineStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotMarker
的用法示例。
在下文中一共展示了QwtPlotMarker::lineStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markerLineStyle
/*!
\return a marker's line style
\param key Marker key
*/
QwtMarker::LineStyle QwtPlot::markerLineStyle(long key) const
{
QwtPlotMarker *m = d_markers->find(key);
if (m)
return m->lineStyle();
else
return QwtMarker::NoLine;
}
示例2: closestMarker
/*!
\brief Find the marker which is closest to a given point.
\param xpos
\param ypos coordinates of a point in the plotting region
\retval dist Distance in points between the marker and the specified point.
\return Key of the closest marker or 0 if no marker was found
*/
long QwtPlot::closestMarker(int xpos, int ypos, int &dist) const
{
QwtDiMap map[axisCnt];
for ( int axis = 0; axis < axisCnt; axis++ )
map[axis] = canvasMap(axis);
long rv = 0;
double dmin = 1.0e10;
QwtPlotMarkerIterator itm = markerIterator();
for (QwtPlotMarker *m = itm.toFirst(); m != 0; m = ++itm )
{
double cx = map[m->xAxis()].xTransform(m->xValue());
double cy = map[m->yAxis()].xTransform(m->yValue());
if (m->lineStyle() == QwtMarker::HLine)
{
if (m->symbol().style() == QwtSymbol::None)
cx = double(xpos);
}
else if (m->lineStyle() == QwtMarker::VLine)
{
if (m->symbol().style() == QwtSymbol::None)
cy = double(ypos);
}
double f = qwtSqr(cx - double(xpos)) + qwtSqr(cy - double(ypos));
if (f < dmin)
{
dmin = f;
rv = itm.currentKey();
}
}
dist = int(sqrt(dmin));
return rv;
}