本文整理汇总了C++中QwtPlotMarker::setZ方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::setZ方法的具体用法?C++ QwtPlotMarker::setZ怎么用?C++ QwtPlotMarker::setZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotMarker
的用法示例。
在下文中一共展示了QwtPlotMarker::setZ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakePlotItems
void Nullcline::MakePlotItems()
{
#ifdef DEBUG_FUNC
ScopeTracker st("Nullcline::MakePlotItems", std::this_thread::get_id());
#endif
std::unique_lock<std::mutex> lock( Mutex() );
if (_packets.empty()) return;
while (_packets.size()>1)
{
delete _packets.front();
_packets.pop_front();
}
Record* record = _packets.front();
_packets.pop_front();
if (!record) return;
lock.unlock();
ClearPlotItems();
const size_t xidx = Spec_toi("xidx"),
yidx = Spec_toi("yidx"),
resolution2 = NumParserMgrs(),
resolution = (int)sqrt(resolution2);
const std::vector< std::pair<int,int> >& xcross_h = record->xcross_h,
& xcross_v = record->xcross_v,
& ycross_h = record->ycross_h,
& ycross_v = record->ycross_v;
const double* x = record->x,
* y = record->y;
const double xinc = record->xinc,
yinc = record->yinc;
const size_t xnum_pts_h = xcross_h.size(),
xnum_pts_v = xcross_v.size(),
ynum_pts_h = ycross_h.size(),
ynum_pts_v = ycross_v.size();
ReservePlotItems(xnum_pts_h + xnum_pts_v + ynum_pts_h + ynum_pts_v);
const QColor& xcolor = _colors.at(xidx+1);
for (size_t i=0; i<xnum_pts_h; ++i)
{
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
QBrush(xcolor), QPen(xcolor, 2), QSize(5, 5) );
QwtPlotMarker* marker = new QwtPlotMarker();
marker->setSymbol(symbol);
const int idx = xcross_h.at(i).first*resolution + xcross_h.at(i).second;
marker->setXValue(x[idx] + xinc/2.0);
marker->setYValue(y[idx]);
marker->setZ(-1);
AddPlotItem(marker);
}
for (size_t i=0; i<xnum_pts_v; ++i)
{
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
QBrush(xcolor), QPen(xcolor, 2), QSize(5, 5) );
QwtPlotMarker* marker = new QwtPlotMarker();
marker->setSymbol(symbol);
const int idx = xcross_v.at(i).first*resolution + xcross_v.at(i).second;
marker->setXValue(x[idx]);
marker->setYValue(y[idx] + yinc/2.0);
marker->setZ(-1);
AddPlotItem(marker);
}
QColor ycolor = _colors.at(yidx+1);
for (size_t i=0; i<ynum_pts_h; ++i)
{
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
QBrush(ycolor), QPen(ycolor, 2), QSize(5, 5) );
QwtPlotMarker* marker = new QwtPlotMarker();
marker->setSymbol(symbol);
const int idx = ycross_h.at(i).first*resolution + ycross_h.at(i).second;
marker->setXValue(x[idx] + xinc/2.0);
marker->setYValue(y[idx]);
marker->setZ(-1);
AddPlotItem(marker);
}
for (size_t i=0; i<ynum_pts_v; ++i)
{
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
QBrush(ycolor), QPen(ycolor, 2), QSize(5, 5) );
QwtPlotMarker* marker = new QwtPlotMarker();
marker->setSymbol(symbol);
const int idx = ycross_v.at(i).first*resolution + ycross_v.at(i).second;
marker->setXValue(x[idx]);
marker->setYValue(y[idx] + yinc/2.0);
marker->setZ(-1);
AddPlotItem(marker);
}
DrawBase::Initialize(); //Have to wait on this, since we don't know how many objects there
//are until the analysis is complete
delete record;
}