本文整理汇总了C++中KstViewWindow::createPlot方法的典型用法代码示例。如果您正苦于以下问题:C++ KstViewWindow::createPlot方法的具体用法?C++ KstViewWindow::createPlot怎么用?C++ KstViewWindow::createPlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstViewWindow
的用法示例。
在下文中一共展示了KstViewWindow::createPlot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newObject
//.........这里部分代码省略.........
}
KstHsNormType new_norm_mode;
if (_w->NormIsPercent->isChecked()) {
new_norm_mode = KST_HS_PERCENT;
} else if (_w->NormIsFraction->isChecked()) {
new_norm_mode = KST_HS_FRACTION;
} else if (_w->PeakIs1->isChecked()) {
new_norm_mode = KST_HS_MAX_ONE;
} else {
new_norm_mode = KST_HS_NUMBER;
}
KstHistogramPtr hs;
KST::vectorList.lock().readLock();
KstVectorPtr vp = *KST::vectorList.findTag(_w->_vector->selectedVector());
KST::vectorList.lock().unlock();
if (vp) {
KstVCurvePtr vc;
KstViewWindow *w;
QColor color;
vp->readLock();
hs = new KstHistogram(tag_name, vp, new_min, new_max,
new_n_bins, new_norm_mode);
vp->unlock();
hs->setRealTimeAutoBin(_w->_realTimeAutoBin->isChecked());
// xxx color = KstApp::inst()->chooseColorDlg()->getColorForCurve(hs->vX(), hs->vY());
if (!color.isValid()) {
color = _w->_curveAppearance->color();
}
vc = new KstVCurve(KST::suggestCurveName(hs->tag(), true), hs->vX(), hs->vY(), KstVectorPtr(), KstVectorPtr(), KstVectorPtr(), KstVectorPtr(), color);
vc->setHasPoints(_w->_curveAppearance->showPoints());
vc->setHasLines(_w->_curveAppearance->showLines());
vc->setHasBars(_w->_curveAppearance->showBars());
vc->setPointStyle(_w->_curveAppearance->pointType());
vc->setLineWidth(_w->_curveAppearance->lineWidth());
vc->setLineStyle(_w->_curveAppearance->lineStyle());
vc->setBarStyle(_w->_curveAppearance->barStyle());
vc->setPointDensity(_w->_curveAppearance->pointDensity());
QString legendText = _legendText->text();
if (legendText == defaultTag) {
vc->setLegendText(QString(""));
} else {
vc->setLegendText(legendText);
}
/* xxx
w = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow(_w->_curvePlacement->_plotWindow->currentText()));
*/
if (!w) {
QString n = KstApp::inst()->newWindow(KST::suggestWinName());
// xxx w = static_cast<KstViewWindow*>(KstApp::inst()->findWindow(n));
}
if (w) {
Kst2DPlotPtr plot;
if (_w->_curvePlacement->existingPlot()) {
plot = kst_cast<Kst2DPlot>(w->view()->findChild(_w->_curvePlacement->plotName()));
if (plot) {
plot->addCurve(vc);
}
}
if (_w->_curvePlacement->newPlot()) {
QString name = w->createPlot(KST::suggestPlotName());
if (_w->_curvePlacement->reGrid()) {
w->view()->cleanup(_w->_curvePlacement->columns());
}
plot = kst_cast<Kst2DPlot>(w->view()->findChild(name));
if (plot) {
_w->_curvePlacement->update();
_w->_curvePlacement->setCurrentPlot(plot->tagName());
plot->addCurve(vc);
plot->generateDefaultLabels();
}
}
}
KST::dataObjectList.lock().writeLock();
KST::dataObjectList.append(hs);
KST::dataObjectList.append(vc);
KST::dataObjectList.lock().unlock();
hs = 0L;
vc = 0L;
emit modified();
}
return true;
}