本文整理汇总了C++中Kst2DPlotList::findTag方法的典型用法代码示例。如果您正苦于以下问题:C++ Kst2DPlotList::findTag方法的具体用法?C++ Kst2DPlotList::findTag怎么用?C++ Kst2DPlotList::findTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kst2DPlotList
的用法示例。
在下文中一共展示了Kst2DPlotList::findTag方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPlotAxes
bool KstIfaceImpl::setPlotAxes(const QString& plotName,
int XLower,
int XUpper,
int YLower,
int YUpper) {
//find the plot
KstApp *app = KstApp::inst();
KMdiIterator<KMdiChildView*> *iter = app->createIterator();
while (iter->currentItem()) {
KMdiChildView *childview = iter->currentItem();
KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
if (viewwindow) {
Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
Kst2DPlotList::Iterator plot_iter=plotlist.findTag(plotName);
if (plot_iter != plotlist.end()) {
app->deleteIterator(iter);
(*plot_iter)->setXScaleMode(FIXED);
(*plot_iter)->setYScaleMode(FIXED);
(*plot_iter)->setScale(XLower, YLower,
XUpper, YUpper); //set the scale
// repaint the plot
(*plot_iter)->setDirty();
viewwindow->view()->paint(KstPainter::P_PLOT);
return true;
}
}
iter->next();
}
app->deleteIterator(iter);
return false;
}
示例2: removeCurveFromPlot
bool KstIfaceImpl::removeCurveFromPlot(KMdiChildView *win, const QString& plot, const QString& curve) {
KstViewWindow *w = dynamic_cast<KstViewWindow*>(win);
if (w) {
KstTopLevelViewPtr view = kst_cast<KstTopLevelView>(w->view());
if (view) {
Kst2DPlotList plots = view->findChildrenType<Kst2DPlot>(true);
if (plots.findTag(plot) != plots.end()) {
Kst2DPlotPtr p = *(plots.findTag(plot));
KstBaseCurveList bcl = kstObjectSubList<KstDataObject,KstBaseCurve>(KST::dataObjectList);
KstBaseCurveList::Iterator ci = bcl.findTag(curve);
if (p && ci != bcl.end()) {
p->removeCurve(*ci);
_doc->forceUpdate();
return true;
}
}
}
}
return false;
}
示例3: plotContents
QStringList KstIfaceImpl::plotContents(const QString& name) {
//iterate through the windows until plot is found
KstApp *app = KstApp::inst();
KMdiIterator<KMdiChildView*> *iter = app->createIterator();
while (iter->currentItem()) {
KMdiChildView *childview = iter->currentItem();
KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
if (viewwindow) {
Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
Kst2DPlotList::Iterator plot_iter=plotlist.findTag(name);
if (plot_iter != plotlist.end()) {
app->deleteIterator(iter);
return (*plot_iter)->Curves.tagNames();
}
}
iter->next();
}
app->deleteIterator(iter);
return QStringList();
}
示例4: toggleMaximizePlot
bool KstIfaceImpl::toggleMaximizePlot(const QString& plotName) {
KstApp *app = KstApp::inst();
KMdiIterator<KMdiChildView*> *iter = app->createIterator();
while (iter->currentItem()) {
KMdiChildView *childview = iter->currentItem();
KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
if (viewwindow) {
Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
if (plot_iter != plotlist.end()) {
app->deleteIterator(iter);
(*plot_iter)->zoomToggle();
return true;
}
}
iter->next();
}
app->deleteIterator(iter);
return false;
}
示例5: addPlotMarker
bool KstIfaceImpl::addPlotMarker(const QString &plotName, double markerValue) {
//find the plot
KstApp *app = KstApp::inst();
KMdiIterator<KMdiChildView*> *iter = app->createIterator();
while (iter->currentItem()) {
KMdiChildView *childview = iter->currentItem();
KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
if (viewwindow) {
Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
Kst2DPlotList::Iterator plot_iter=plotlist.findTag(plotName);
if (plot_iter != plotlist.end() && (*plot_iter)->setPlotMarker(markerValue)) {
app->deleteIterator(iter);
// repaint the plot
(*plot_iter)->setDirty();
viewwindow->view()->paint(KstPainter::P_PLOT);
return true;
}
}
iter->next();
}
app->deleteIterator(iter);
return false;
}
示例6: plotEquation
bool KstIfaceImpl::plotEquation(const QString& xvector, const QString& equation, const QString& plotName, const QColor& color) {
KstVectorPtr v;
Kst2DPlotPtr plot;
QString etag, ptag;
KST::vectorList.lock().readLock();
KstVectorList::Iterator it = KST::vectorList.findTag(xvector);
KST::vectorList.lock().unlock();
KstApp *app = KstApp::inst();
if (equation.isEmpty() || it == KST::vectorList.end()) {
return false;
}
v = *it;
etag = KST::suggestEQName(QString(equation).replace(QRegExp("[\\[\\]\\s]"), "_"));
ptag = "P-" + plotName;
if (!plotName.isEmpty()) {
//find the plot, or P-plotName
KMdiIterator<KMdiChildView*> *iter = app->createIterator();
bool found = false;
while (iter->currentItem() && !found) {
KMdiChildView *childview = iter->currentItem();
KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
if (viewwindow && !found) {
Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
if (plot_iter != plotlist.end()) {
plot = *plot_iter;
found = true;
}
else {
Kst2DPlotList::Iterator plot_iter = plotlist.findTag(ptag);
if (plot_iter != plotlist.end()) {
plot = *plot_iter;
found = true;
}
}
}
iter->next();
}
app->deleteIterator(iter);
}
//if the plot does not exist, create it
if (!plot) {
//put the plot in the active window
KMdiChildView *activewin = app->activeWindow();
if (!activewin) {
QString windowname = app->newWindow("W1");
activewin = app->findWindow(windowname);
}
KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(activewin);
if (viewwindow) {
KstTopLevelViewPtr pTLV = viewwindow->view();
plot = pTLV->createObject<Kst2DPlot>(ptag);
}
}
KstEquationPtr eq = new KstEquation(etag, equation, v, true);
if (!eq->isValid()) {
return false;
}
KstVCurveList vcurves = kstObjectSubList<KstBaseCurve,KstVCurve>(plot->Curves);
KstVCurvePtr vc = new KstVCurve(KST::suggestCurveName(etag, true), eq->vX(), eq->vY(), 0L, 0L, 0L, 0L, color.isValid() ? color : KstColorSequence::next(vcurves,plot->backgroundColor()));
KST::dataObjectList.lock().writeLock();
KST::dataObjectList.append(KstDataObjectPtr(eq));
KST::dataObjectList.append(KstDataObjectPtr(vc));
KST::dataObjectList.lock().unlock();
plot->addCurve(KstBaseCurvePtr(vc));
_doc->forceUpdate();
_doc->setModified();
return true;
}